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

6 visualizaciones (últimos 30 días)
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);

Respuesta aceptada

Image Analyst
Image Analyst el 12 de En. de 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);

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by