Diameter of a droplet using image processing
6 ビュー (過去 30 日間)
古いコメントを表示
I would like to know how to get the maximum diameter of a droplet using image processing toolbox.
1 件のコメント
Deependra Kumar
2023 年 8 月 23 日
I have worked on same problem.
here is the github code link:- https://github.com/DeepsDK4/Droplet_Spreading_diameter/tree/main/Droplet%20diameter%20calculation
採用された回答
DGM
2021 年 10 月 29 日
編集済み: DGM
2021 年 10 月 29 日
A simple method that works at least for this image:
A = rgb2gray(imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/782708/image.jpeg'));
A = imfill(bwareafilt(A<50,1),'holes');
S = regionprops(A,'boundingbox');
blobwidth = S.BoundingBox(3) % in pixels
% show the extents for reference
imshow(A); hold on
rectangle('position',S.BoundingBox,'edgecolor','y')
You'll have to convert that to mm.
0 件のコメント
その他の回答 (1 件)
yanqi liu
2021 年 10 月 29 日
編集済み: yanqi liu
2021 年 10 月 29 日
sir,please check the follow code to get some information
clc; clear all; close all;
im = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/782708/image.jpeg');
im = rgb2gray(im);
bw = imbinarize(im,'adaptive','ForegroundPolarity','dark','Sensitivity',0.85);
bw = imclearborder(bw);
bw = bwareaopen(bw, 100);
[L,num] = bwlabel(bw);
stats = regionprops(L);
figure; imshow(im);
for i = 1 : num
recti = stats(i).BoundingBox;
ceni = stats(i).Centroid;
hold on; rectangle('position', recti, 'EdgeColor', 'g', 'LineWidth', 2)
text(ceni(1), ceni(2), sprintf('width=%.1f', recti(3)), 'Color', 'r');
end
figure; imshow(bw);
rects=cat(1,stats.BoundingBox);
disp(max(rects(:, 3)))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


