How can i extract desired image from an image?

조회 수: 5 (최근 30일)
Usman
Usman 2015년 11월 22일
댓글: Image Analyst 2015년 11월 22일
In the attached figure, I have to extract the visible part (i.e. rectangular eye part) in order to have focused eye region. I have tried imcrop function and it does what I need. But everytime i have to select the image co-ordinates. I want to do it automatically, like MATLAB itself sense the co-ordinates and extract that focused eye part. I mean there might be some algorithm which can vanish the black part and extract visible one. anybody have idea, how to do it?
cr1=imcrop(fmr_ext1,[500.5 388.5 85 117]);

채택된 답변

Image Analyst
Image Analyst 2015년 11월 22일
You can get the bounding box and then use crop:
measurements = regionprops(grayImage>0, 'BoundingBox');
croppedImage = imcrop(grayImage, measurements.BoundingBox);
  댓글 수: 7
Usman
Usman 2015년 11월 22일
thanks it works in 2015a..thankyou alot
Image Analyst
Image Analyst 2015년 11월 22일
See my own function, attached, written before they came out with bwareafilt().

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by