set the outside pixel values into zero.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen

hi, im doing a iris recognition. After iris circle (iris region) detection, i need an automatic cropping or masking method to mask the regions other than iris. and i found one of the method is to set the outside pixel. how to set the outside pixel values into zero or any others method how to extract the iris region?
0 Kommentare
Antworten (2)
Muhammad Usman Saleem
am 1 Mär. 2016
Try from them
https://www.researchgate.net/post/Is_it_possible_to_automatically_crop_images_in_MATLAB_from_any_image
Assinging 0 to outside pixels is not a correct idea. Image size and data remains as usuall
0 Kommentare
Image Analyst
am 1 Mär. 2016
It looks like you already have coordinates for a circle. So just pass those in to poly2mask to create a mask. Then use it as logical indexes to zero out that part.
% Create mask from circle coordinates.
[rows, columns, numColorChannels] = size(grayImage);
irisMask = poly2mask(x, y, rows, columns);
% Mask outside the circle to black, 0.
grayImage(~irisMask) = 0;
After that you want to "extract the region". Exactly what does that mean? Do you want the mean inside the iris? Do you want to create a new smaller image by cropping the iris portion? By the way, it's not necessary to blacken the image outside the iris to do either of those.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Computer Vision with Simulink finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!