I am trying to find each particle area and each particle intensity through matlab.

36 views (last 30 days)
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.

Answers (2)

TED MOSBY
TED MOSBY on 27 Mar 2025
Hi Tharun,
To measure particle area and total intensity you can follow the below steps:
  • 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:
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 Comments
Walter Roberson
Walter Roberson on 3 Apr 2025
Edited: Walter Roberson on 19 Jun 2025 at 17:19
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.
Tharun
Tharun on 19 Jun 2025 at 8:05
Actually the above is image is of gold nanoparticle. Do anyone know how to find intensity of every individual particle by Guassian method that can show the peak intensity and low intensity of particle irrespective of particle shape?

Sign in to comment.


Image Analyst
Image Analyst on 19 Jun 2025 at 11:48
Edited: Image Analyst on 20 Jun 2025 at 17:49
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]

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!