Overlap / Combine two image

조회 수: 14 (최근 30일)
Syahrul Niezam
Syahrul Niezam 2012년 2월 1일
Is there any idea to combine/overlap two images into one? I would like to combine the foreground and background in this image.
I wish only the human image remained after the fusion, but after I tried it, the background did not turn to be totally black. Is there any idea to enhance it? Thank you.

채택된 답변

Anton Semechko
Anton Semechko 2012년 2월 1일
By convention foreground is usually white (pixel value = 1) and background is black (pixel value = 0). Suppose IM is your original grayscale image and BW is a binary image of the same size as IM, where positive pixels (i.e. those that have value = 1) belong to the foreground. To subtract the background from IM, do the following:
IM(~BW)=0;
  댓글 수: 1
Syahrul Niezam
Syahrul Niezam 2012년 2월 1일
Thanks a lot! :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by