Post dissolution particle size prediction
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
praguna manvi
le 31 Déc 2024
Modifié(e) : praguna manvi
le 31 Déc 2024
Here is a useful discussion thread on calculating partical area during dissolution :
Réponses (1)
Pratyush Swain
le 2 Jan 2025
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
1. regionprops: https://www.mathworks.com/help/images/ref/regionprops.html
3. imbinarize: https://www.mathworks.com/help/images/ref/imbinarize.html.
I hope this helps, I have also attached the sample particle image for your reference.
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!