我该怎样摆脱反射点?

Ala*_*isy 1 matlab image image-processing

我有这些虹膜图像,我想摆脱反射点.有什么建议吗?我不想将其像素值设置为零.我希望他们像邻居像素一样正常.先感谢您.

示例图片:

在此输入图像描述

Sha*_*hai 5

你可以使用roifill功能

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
Run Code Online (Sandbox Code Playgroud)

你得到(原件在左边,J在右边):

在此输入图像描述


根据kkuilla,roifill最近的Matlab版本不支持,regionfill应该使用:

J = regionfill( img, imdilate( sp, ones( 5 ) ) );
Run Code Online (Sandbox Code Playgroud)