How to extract the ROI using impoly?
조회 수: 3 (최근 30일)
이전 댓글 표시
Sabarinathan Vadivelu
2012년 10월 8일
답변: Karbala'a Unvi. Science
2014년 11월 21일
using impoly(); how to extract the Region of Interest alone?? Here Im getting Errors.
grayImage = imread('pout.tif');
figure, imshow(grayImage);
h = impoly;
position = wait(h);
croppedImage = imcrop(grayImage, position);
figure;
imshow(croppedImage);
댓글 수: 0
채택된 답변
David Legland
2012년 10월 8일
편집: David Legland
2012년 10월 8일
Hi,
You should use either imcrop, or impoly.
Using imcrop, you can select a rectangular region of interset. By the way, there is also a syntax "IMG2 = imcrop(IMG);". You can use like this:
grayImage = imread('pout.tif');
figure, imshow(grayImage);
img2 = imcrop;
imshow(img2)
Using impoly, you can select a polygonal region of interest. This polygon can be represented as an ordered list of vertex coordinates. You can then convert this polygon into a binary mask by using "roipoly" function.
regards, David
댓글 수: 0
추가 답변 (1개)
Karbala'a Unvi. Science
2014년 11월 21일
hi, I need the help in reconstruct the cropped image back to the original image... PLS need the help urgently
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!