Get Number of Grains

7 ビュー (過去 30 日間)
Parth Desai
Parth Desai 2018 年 9 月 14 日
コメント済み: AMAR P 2018 年 9 月 25 日
Hello,
Below link is having a sample program of finding grain size using line intercept method [Public_matlab_code_v1b.zip] In this sample how can I get Number of Grains present in the Input image. Example code is having one EBSD image as well, how can I convert my rgb images to EBSD so that I can use the attached example.

回答 (1 件)

AMAR P
AMAR P 2018 年 9 月 25 日
編集済み: AMAR P 2018 年 9 月 25 日
hi, I gave it a try. Check with the code below. There are couple of intensity transformation need to be perform to get sharp images. Furthermore, I will also suggest you to try Edge filter to enhance them.
MainImg = imread('temp.bmp');
% Convert to GrayScale Image [To perform histeq]
GrayImg = rgb2gray(MainImg);
% Intensity transformation
GrayImg = histeq(GrayImg);
% Convert to Binary Image
BinImg = im2bw(GrayImg);
%Get Region props
GrainProps = regionprops('table', BinImg,'Centroid');
% Get No of Grains in the image
NoOfGrains = numel(GrainProps);
%Read All Centers into Array
GrainCenters = GrainProps.Centroid;
% Mark Grains at Center.
figure(1);
imshow(BinImg);
hold on;
text(GrainCenters(:,1), GrainCenters(:,2),'*','Color','r');
hold off
fprintf('\nNo. Of Grains found in the Image = %d\n', NoOfGrains);
  1 件のコメント
AMAR P
AMAR P 2018 年 9 月 25 日
Approx 610 Grains found.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Filtering and Enhancement についてさらに検索

製品


リリース

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by