I have an image of an eye. I wanted to detect and crop the conjunctival region. How should I go about this?

5 views (last 30 days)

Answers (1)

Image Analyst
Image Analyst on 27 Aug 2016
Try imfreehand(). Demo attached.
  2 Comments
Medha Sharma
Medha Sharma on 28 Aug 2016
Edited: Image Analyst on 28 Aug 2016
Thanks for your consideration. I tried out your code with my image set. This is the message I obtained:
Warning: Image is too big to fit on screen; displaying at 13%
> In images.internal.initSize (line 71)
In imshow (line 309)
In sol (line 38)
Error using iptassert (line 19)
Size of I doesn't match size information found in the first input argument.
Error in regionprops>ParseInputs (line 1224)
iptassert(isequal(sizeImage,size(I)), ...
Error in regionprops (line 205)
[I,requestedStats,officialStats] = ParseInputs(imageSize, argOffset, varargin{:});
Error in sol (line 66)
measurements = regionprops(binaryImage, img, ...
Basically, my aim was to somehow identify and crop out the conjunctival region from the image of an eye and then obtain the RGB intensities of the cropped out region. Could this be accomplished by any other means?
Image Analyst
Image Analyst on 28 Aug 2016
The first is just a warning that says it's shrinking your image to fit it onto the screen. You can ignore that warning.
The second one is where it tried to do regionprops to compute the area or something. It was expecting to have a gray scale image and you probably passed it the full color image. You can either do that on the 3 color channels one at a time, or you can somehow create a gray scale image, or simply just don't use regionprops. I'm not really sure what you want after you hand-draw the region. Do you want a smaller image where it has just the bounding box of the small region you traced? Or do you want to mask out (blacken) the area of your image outside the region you traced?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!