How can I remove unnecessary reflections in a image after background subtraction
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Rohit Thokala
el 11 de En. de 2022
Respondida: Image Analyst
el 12 de En. de 2022
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);
0 comentarios
Respuesta aceptada
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);
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!