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!