필터 지우기
필터 지우기

how to crop a particular location of a image?

조회 수: 1 (최근 30일)
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2012년 9월 11일
I have drawn a star on a image and i want to crop that star region alone. How to do it?
  댓글 수: 2
Andrei Bobrov
Andrei Bobrov 2012년 9월 11일
use function crop from Image Processing Toolbox
KIRAN kumar
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
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?

추가 답변 (1개)

Walter Roberson
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
Walter Roberson 2013년 1월 18일
I saw it back then but I was busy and I figured someone else would answer.
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2013년 1월 18일
Even though it is late, I thank you both Image Analyst and Walter.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by