Recovering the rings and measuring thier radius

Hello,
Here, I have Newton's Rings generated using FDTD (and then exported to MATLAB). I want to measure the radius of the rings but the Binary image is displaying some discontnuity. I have used "im_bin =
imbinarize(img_rgb,"adaptive","ForegroundPolarity","dark",'Sensitivity',0.25);
" this to binarize the image. your assitance is highly appreciated.

4 commentaires

KSSV
KSSV le 16 Mai 2023
Attach your image nd code you have tried.
clc;
close all ;
I = imread('voidIntensity.png');
Error using imread>get_full_filename
File "voidIntensity.png" does not exist.

Error in imread (line 372)
fullname = get_full_filename(filename);
img_rgb = rgb2gray(I);
im_bin = imbinarize(img_rgb,"adaptive","ForegroundPolarity","dark",'Sensitivity',0.25);
SE = strel("disk",5);
im_dil = imdilate(im_bin,SE);
subplot(2,2,1), imshow(I), title('Original Image');
subplot(2,2,2), imshow(img_rgb), title('Gray Image');
subplot(2,2,3), imshow(im_bin), title('Binary Image');
%subplot(2,2,4), imshow(im_dil), title('Dilated Image');
CC = bwconncomp(im_bin);
% Measure the outer radius
BWout = ~BW;
BWout = imfill(BWout,'holes');
statOuter = regionprops(BWout,{'EquivDiameter','Centroid'});
outerRadius = statOuter.EquivDiameter;
% Measure the inner radius
BWin = imclearborder(BW);
BWin = imopen(BWin, strel('disk',5)); % Remove noise
statInner = regionprops(BWin,{'EquivDiameter','Centroid'});
innerDiameter = statInner.EquivDiameter;
Karan Singh
Karan Singh le 30 Août 2023
Hey Biniam please attach the image file too. Cause the code looks good. if you could provide it then I can look further into it.
Hi Biniam,
It may be useful to attch the image file.
The "Sensitivity" parameter in the imbinarize function controls the thresholding sensitivity. It may be useful to experiment with different sensitivity values to find the optimal threshold that captures the rings without introducing excessive noise or discontinuity

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange

Question posée :

le 16 Mai 2023

Modifié(e) :

le 7 Sep 2023

Community Treasure Hunt

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

Start Hunting!

Translated by