How do i Crop out the Only sclera portion from image of an eye ?

3 visualizzazioni (ultimi 30 giorni)
i have used Hough Transform to detect the radius of the Limb & its Centre. after that i used Chen-vese Active Contour to detect the Limb Portion & i got the its mask. but i need Help in subtraction of image so that i can get Only Sclera portion from the Original image of eye.
So help me Get the Only Schlera portion so that the output image have the Sclera with veins ? Thanks.
##Original Image
##Limb Detection with its Position & Radius.
## Active Contour Detection of Limb to Crop the Schlera Out.
##Mask Output after 1000 iteration
I=imread('K.jpg');
L=rgb2gray(I);
BW1 = edge(L,'Canny');
imshow(BW1);
radii = 78:1:92;
h = circle_hough(BW1, radii, 'same', 'normalise');
peaks = circle_houghpeaks(h, radii, 'nhoodxy', 15, 'nhoodr', 21, 'npeaks', 1);
imshow(I);
hold on;
for peak = peaks
[x, y] = circlepoints(peak(3));
plot(x+peak(1), y+peak(2), 'g-');
end
hold off
figure;
imshow(I);
a=peak(1);
b=peak(2);
c=peak(3);
% Customerlized Mask
m = zeros(size(I,1),size(I,2));
m(20:120,20:120) = 1;
% Built-in Mask
seg = chenvese(I,'small',1000,0.02,'chan'); % ability on gray image
%-- End
imshow(seg);
  2 Commenti
Image Analyst
Image Analyst il 28 Ago 2018
It's "Chan-Vese" after the authors of an algorithm for active contours. It's implemented in the activecontour() function of the Image Processing Toolbox.

Accedi per commentare.

Risposte (4)

Image Analyst
Image Analyst il 2 Mag 2016
If you want the iris only on that particular image, I'd use imopen() on the binary image to separate it from the rest of the clutter. Or try imfindcircles(). Then call bwareafilt(binaryImage, 1) to extract only the iris since it will be the largest blob.
For finding the sclera, you can check the literature: http://www.visionbib.com/bibliography/contentsmedical.html#Medical%20Applications,%20CAT,%20MRI,%20Ultrasound,%20Heart%20Models,%20Brain%20Models. My guess is that they first convert to HSV colorspace and look for regions with low saturation and high value - that would segment out white regions.
Use the Color Thresholder app on the Apps tab on the tool ribbon. Or see the HSV segmentation demo in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
  8 Commenti
Image Analyst
Image Analyst il 16 Nov 2023
@mak carlos or Akshaya, try imfindcircles if the link Walter just gave does not work.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Do it in a new discussion thread, not here in @Dipesh Gupta's 7 year old question.

Accedi per commentare.


Prince Jindal
Prince Jindal il 28 Gen 2017
hi Dipesh
Just take pixel by pixel product of original image and complemented binary mask you generated.
  1 Commento
Image Analyst
Image Analyst il 28 Gen 2017
This is how you'd do that:
% Mask the image using bsxfun() function
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask, 'like', rgbImage));
This will give the middle image of the three images he posted in a comment to my Answer, so he's already doing this. I'm not sure what or if he had any questions after that.

Accedi per commentare.


RIDZA
RIDZA il 13 Lug 2017
%This code can be used if you know the x,y and r %only functioning using .jpg image % [filename, pathname] = uigetfile({'*.jpg';'*.bmp';'*.tif'}); [filename, pathname] = uigetfile({'/*.*'}); S = imread([pathname filename]);
%I = imread('088_1_2.jpg'); imageSize = size(I); % center and radius of circle ([c_row, c_col, r]) [xx,yy] = ndgrid((1:imageSize(1))-ci(1),(1:imageSize(2))-ci(2)); mask = uint8((xx.^2 + yy.^2)<ci(3)^2); croppedImage = uint8(zeros(size(I))); croppedImage(:,:,1) = I(:,:,1).*mask; croppedImage(:,:,2) = I(:,:,2).*mask; croppedImage(:,:,3) = I(:,:,3).*mask; imshow(croppedImage);
  1 Commento
Laisa Fernochio
Laisa Fernochio il 4 Nov 2017
Hello Dipesh Gupta Can you give me the source code, I only need a code that detect the iris please

Accedi per commentare.


Emilia Badescu
Emilia Badescu il 15 Apr 2018
Hello!! How can detect a value in this white area of the iris to distinguish it from the image that does not show this white area around the iris
  6 Commenti
Image Analyst
Image Analyst il 30 Apr 2018
I'd first find the pupil - easy since it's the largest dark thing. Then use improfile to send out rays to get the average radial profile. Examine that to get the other rings. See similar demos, attached.
Emilia Badescu
Emilia Badescu il 30 Apr 2018
thank you, I'm reading the transformed Hough, but I just find the circle of the iris

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by