Filter löschen
Filter löschen

how to crop a particular location of a image?

1 Ansicht (letzte 30 Tage)
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran am 11 Sep. 2012
I have drawn a star on a image and i want to crop that star region alone. How to do it?
  2 Kommentare
Andrei Bobrov
Andrei Bobrov am 11 Sep. 2012
use function crop from Image Processing Toolbox
KIRAN kumar
KIRAN kumar am 18 Jan. 2013
select the area first by selecting the star by defining it then perform corp.u can use image segmentation process for this

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 18 Jan. 2013
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?

Weitere Antworten (1)

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

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by