MATLAB: How to remove small grid holes from image while keeping larger, more intense light

image processingMATLAB

Hello All,
I'm looking to remove the smaller, less intense light coming from the small grid holes from images such as the one below.
TEM1_NR_Y_532nm_Exp0.9s_100xMag_BG-C.jpg
Thank you

Best Answer

Lets say test_image is the input gray image.
thresholdValue=80; %Decide value as per desired result
segImage=test_image<=thresholdValue;
BW_Image=bwareaopen(~segImage,20);
%..............................^ decide this value as per resired results
test_image(~BW_Image)=0;
figure,imshow(test_image);
result12.png