how to crop a particular location of a image?
1 回表示 (過去 30 日間)
古いコメントを表示
I have drawn a star on a image and i want to crop that star region alone. How to do it?
2 件のコメント
KIRAN kumar
2013 年 1 月 18 日
select the area first by selecting the star by defining it then perform corp.u can use image segmentation process for this
採用された回答
Image Analyst
2013 年 1 月 18 日
Use max() and min() to find the extremes of the coordinates you drew. Then you can create a box and use imcrop(). You know that cropping gives you a matrix which is a rectangular shape, right?
0 件のコメント
その他の回答 (1 件)
Walter Roberson
2013 年 1 月 18 日
poly2mask() and use the resulting mask to extract pixels from the image. You will probably also want to calculate the bounding box of the mask and create a rectangular area that size to store the extracted pixels in (as it is not possible to have a matrix which is an irregular shape.)
3 件のコメント
Walter Roberson
2013 年 1 月 18 日
I saw it back then but I was busy and I figured someone else would answer.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!