How can I remove unnecessary reflections in a image after background subtraction

5 visualizzazioni (ultimi 30 giorni)
I want to remove reflections from the binarized image (I believe these reflections are due to improper background subtraction). I can't increase the sensitivity factor (which is 0.15 in my code) of binarization since I have to keep this value constant throughout my project. The sensitivity level which I used is in the code is suitable for most of the images in the analysis. So, I prefer not to change this value. I am attaching image and background for reference. I want to remove circled parts from the binarized image. Thanks in advance.
background = im2uint16(mat2gray(imread("Water_T_140_t_inj_15_P_05_M30010.tif")));
Image = im2uint16(mat2gray(imread("Water_T_140_t_inj_15_P_05_M30300.tif")));
SubtractedImage = Image - background;
GrayImage = rgb2gray(SubtractedImage);
BinaryImage=imbinarize(GrayImage, 0.15);

Risposta accettata

Image Analyst
Image Analyst il 12 Gen 2022
% Remove blobs smaller than 100 pixels in the image
BinaryImage = bwareaopen(BinaryImage, 100);
Or, if you just want to take the largest blob or two
numBlobsToKeep = 1; % However many you want.
BinaryImage = bwareafilt(BinaryImage, numBlobsToKeep);

Più risposte (0)

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by