how to resize an object in binary image ?
5 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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
2016-3-20
You can create a circle mask as shown in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F
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
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 个评论
Walter Roberson
2016-3-20
props = regionprops(YourBinaryImage, 'Image');
extracted_image = props.Image;
smaller_extracted = imresize(extracted_image, [64 64]); %example output size
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!