Reputation: 105
I have these iris images and I want get rid of the reflection spots. Are there any suggestions? I don't want to set their pixels values to zero. I'd like them to be normal as their neighborhood pixels. Thank you in advance.
An example image:
Upvotes: 1
Views: 220
Reputation: 114866
You can use roifill
function
img = imread('https://uk.mathworks.com/matlabcentral/answers/uploaded_files/31683/51-7.bmp');
sp = img > 240; %// find the bright spots, use some high threshold
J = roifill( img, imdilate( sp, ones(5) ) ); %// replace the bright spots
And you get (original on the left, J
on the right):
According to kkuilla, roifill
is not supported for recent Matlab versions, and regionfill
should be used instead:
J = regionfill( img, imdilate( sp, ones( 5 ) ) );
Upvotes: 5