how to resize an object in binary image ?

조회 수: 3(최근 30일)
ElizabethR 2016년 3월 20일
댓글: ElizabethR 2016년 3월 21일
i try to resize (minimize) an object in binary image, but I get the whole picture is to be small. even though I just wanted to minimize only its object. please help me. thanks

채택된 답변

Image Analyst
Image Analyst 2016년 3월 20일
If you want to shrink a binary image in place, without cropping out, then you can use imerode() to eat away outer layers of the binary blob(s).
  댓글 수: 4
Image Analyst
Image Analyst 2016년 3월 20일
You can create a circle mask as shown in the FAQ:
So if the mask is true in the circle and false outside, do
binaryImage(~mask) = true;
For what it's worth, I've also attached a circle masking demo.

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

추가 답변(1개)

Walter Roberson
Walter Roberson 2016년 3월 20일
You need to extract the object first and imresize() on the extracted part. Consider using regionprops with the Image property to get the extracted object.
  댓글 수: 3
ElizabethR 2016년 3월 21일
hi Walter, thanks you so much.. it's working perfectly, now i can extract the object .. but, i want the background ( black ) still there.

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

Community Treasure Hunt

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

Start Hunting!

Translated by