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 件のコメント

KSSV
KSSV 2023 年 5 月 16 日
Attach your image nd code you have tried.
Biniam
Biniam 2023 年 5 月 16 日
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 2023 年 8 月 30 日
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.
Shree Charan
Shree Charan 2023 年 9 月 7 日
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

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Convert Image Type についてさらに検索

質問済み:

2023 年 5 月 16 日

編集済み:

2023 年 9 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by