- Load your image into MATLAB using 'imread'.
- Convert to grayscale if it’s an RGB image (e.g., rgb2gray).
- Use a thresholding function to segment particles from the background.
- Perform morphological operations ('bwareaopen', etc.) to clean up the binary mask.
- Convert the binary mask to a labeled image using 'bwlabel'.
- Each connected particle will have a unique label.
- Use 'regionprops' with both the labeled image and the grayscale image. This gives you each particle’s area, mean intensity, and a list of its pixel values.
- For each particle, the total (integrated) intensity is:
I am trying to find each particle area and each particle intensity through matlab.
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to find each particle area and each particle intensity through matlab. I am using image processing techniques like regionprops, grey image and for intensity i am getting mean intensity. I want to calculate individual or each particle intensity not the mean intensity of partcle. can anyone have anyleads. I am attaching a photo of gold particles for your refernce. 

0 Kommentare
Antworten (2)
TED MOSBY
am 27 Mär. 2025
Hi Tharun,
To measure particle area and total intensity you can follow the below steps:
TotalIntensity=MeanIntensity×Area OR TotalIntensity=summation(Pixelvalues)
I have written an example code for the same:
I = imread('image.jpeg');
if size(I, 3) == 3
Igray = rgb2gray(I); % Convert to grayscale if it is an RGB image
else
Igray = I;
end
level = graythresh(Igray);
BW = imbinarize(Igray, level);
% If needed, remove small noise or fill holes
BW = bwareaopen(BW, 5); % remove objects smaller than 5 pixels (example)
BW = imfill(BW, 'holes');
L = bwlabel(BW);
stats = regionprops(L, Igray, ...
'Area', ...
'MeanIntensity', ...
'PixelValues');
numParticles = numel(stats);
areas = zeros(numParticles,1);
totalIntensities = zeros(numParticles,1);
for k = 1:numParticles
areas(k) = stats(k).Area;
totalIntensities(k) = sum(stats(k).PixelValues);
end
% Display results
table( (1:numParticles)', areas, totalIntensities, ...
'VariableNames', {'ParticleID','Area','TotalIntensity'})
Hope this helps!
3 Kommentare
Walter Roberson
am 3 Apr. 2025
Bearbeitet: Walter Roberson
am 19 Jun. 2025
stats = regionprops(L, Igray, ...
'Area', ...
'MeanIntensity', ...
'PixelValues', ...
'Circularity');
stats = stats([stats.Circularity] > THRESHOLD);
Circular objects have a circularity of 1 (which is the maximum possible for the measurement.) You need to decide on some threshold THRESHOLD beyond which objects are to be consider "close enough" to circular to count.
Image Analyst
am 19 Jun. 2025
Bearbeitet: Image Analyst
am 20 Jun. 2025
Not sure what you mean by "Gaussian method" or by "I want to calculate individual or each particle intensity not the mean intensity of partcle." but regionprops can give you the min and max intensity in each blob. It looks at the actual pixel values inside each blob in your mask, once you've determined your mask.
props = regionprops(mask, grayImage, 'MaxIntensity', 'MinIntensity');
allMax = [props.MaxIntensity]
allMin = [props.MinIntensity]
0 Kommentare
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!