Post dissolution particle size prediction

2 次查看(过去 30 天)
Hi everyone,
Please I am finding it difficult to write a script to predict post-dissolution particle size.
Anyone with previous experience on this?
Can anyone assist.
Kind regards

回答(1 个)

Pratyush Swain
Pratyush Swain 2025-1-2
Hi Shadrack,
You can find the particle size by using thresholding and image segmentation techniques. Afer some pre-processing of the image, you can utilize the 'regionprops' function to calculate particle's area, diameter, and other properties.
Please refer to this example implementation which you can customize or build upon as per your use case:
% Load the image
img = imread('bubble.jpeg');
% Convert to grayscale
gray_img = im2gray(img);
% Perform thresholding
threshold_value = 0.71; % This value can be tuned or adjusted
binary_img = imbinarize(gray_img, threshold_value);
% Label connected components
% This will help to distinguish the particle from the bubbles around it
[L, num] = bwlabel(binary_img);
% Measure the properties of connected components using regionprops function
stats = regionprops(L, 'Area', 'EquivDiameter');
% Find the largest connected component ( have assumed it to be the particle)
all_areas = [stats.Area];
[~, largest_idx] = max(all_areas);
% Extract the particle's properties
particle_area = stats(largest_idx).Area;
equiv_diameter = stats(largest_idx).EquivDiameter;
% Draw a circle using the 'EquivDiameter'
figure;
imshow(gray_img);
hold on;
viscircles(centroid, equiv_diameter / 2, 'EdgeColor', 'r', 'LineWidth', 2); % Draw a circle
title(['Particle with Circle (EquivDiameter): Area = ', num2str(particle_area), ' pixels^2']);
hold off;
The above implementation gives the following result:
The particle's boundary has been highlighted with area displayed at the top.
For more information on image process functions utilized in the implementation, please refer to
I hope this helps, I have also attached the sample particle image for your reference.

标签

Community Treasure Hunt

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

Start Hunting!

Translated by