Diameter of a droplet using image processing
Show older comments
I would like to know how to get the maximum diameter of a droplet using image processing toolbox.
1 Comment
Deependra Kumar
on 23 Aug 2023
I have worked on same problem.
here is the github code link:- https://github.com/DeepsDK4/Droplet_Spreading_diameter/tree/main/Droplet%20diameter%20calculation
Accepted Answer
More Answers (1)
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)))
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

