Effacer les filtres
Effacer les filtres

Through script its possible to identify the particle size????

5 vues (au cours des 30 derniers jours)
vinothkannan K
vinothkannan K le 5 Août 2014
Commenté : vinothkannan K le 8 Août 2014
Am gonna start a new project, From SEM(Scanning Electron Microscopy) Image.... Through matlab script it's possible to identify the particle size????

Réponse acceptée

Amir
Amir le 5 Août 2014
Modifié(e) : Amir le 5 Août 2014
Hi vinothkannan, Please try this code. If your image is .tiff convert it to .jpg before running the code.
clc
clear all
close all
[filename, pathname] = uigetfile('*','File Selector');
I = imread(strcat(pathname,'\',filename)); % for example FileName='MyImage.jpg'
I=im2bw(I);
BW = edge(I,'canny',0.1);
[bw, loc2]= imfill(BW,'holes');
% http://www.mathworks.co.uk/help/images/ref/regionprops.html
rp = regionprops(bw,'All'); % you can specify the parameters which you need
ObjArea=zeros(size(rp,1),1);
CenterX=zeros(size(rp,1),1);
CenterY=zeros(size(rp,1),1);
for i=1:size(rp,1)
ObjArea(i)=rp(i).Area;
CenterX (i)= rp(i).Centroid(1);
CenterY (i)= rp(i).Centroid(2);
end
ObjRadius=(ObjArea./pi).^0.5; % average Radius
Final=[ObjRadius CenterX CenterY];
imshow(I);
hold on
for i=1:size(Final,1)
text(Final(i,2),Final(i,3),num2str(Final(i,1)),...
'HorizontalAlignment' , 'center',...
'VerticalAlignment' , 'middle');
end
title('Average Radius of Particles');

Plus de réponses (0)

Catégories

En savoir plus sur Image Processing and Computer Vision dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by