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

조회 수: 10 (최근 30일)
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.

답변 (2개)

TED MOSBY
TED MOSBY 2025년 3월 27일
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
Walter Roberson
Walter Roberson 2025년 4월 3일
편집: Walter Roberson 2025년 6월 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 2025년 6월 19일
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?

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2025년 6월 19일
편집: Image Analyst 2025년 6월 20일
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]

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by