How can find area of the dent detected?

1 回表示 (過去 30 日間)
vijendra sn
vijendra sn 2014 年 9 月 3 日
コメント済み: Image Analyst 2021 年 10 月 12 日
Hi, i have already found the dent in the laminates but i need find the area of the dent
please help me on this
  2 件のコメント
Samadhan Kshirsagar
Samadhan Kshirsagar 2021 年 10 月 12 日
by which method you have found dent?
Image Analyst
Image Analyst 2021 年 10 月 12 日

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

採用された回答

Image Analyst
Image Analyst 2014 年 9 月 3 日
You forgot to attach your image. All I can suggest then is to run my Image Segmentation Tutorial: http://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial---blobsdemo--
  12 件のコメント
vijendra sn
vijendra sn 2014 年 9 月 15 日
編集済み: Image Analyst 2014 年 9 月 15 日
My Matlab version is 7.10.0.499(2010a).
Image Analyst
Image Analyst 2014 年 9 月 15 日
Please upgrade. What happens when you say "which bwconvhull"?

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

その他の回答 (1 件)

vijendra sn
vijendra sn 2014 年 9 月 22 日
Hi,
i used bwconvhull function...how to analyze this function but still i couldn't get how to find area of the these dent detected. There are 9 dent area detected.
How to find the area of the 1 pixel in image
close all;
clear all;
clc;
A = imread('DSC_0977.jpg');
B = rgb2gray(A);
hx = fspecial('sobel');
hy = hx';
Iy = imfilter(double(B), hy, 'circular');
Ix = imfilter(double(B), hx, 'circular');
gradmag = sqrt(Ix.^2 + Iy.^2);
k=figure(1),imshow(gradmag,[]);
set(k, 'visible','off');
filename = 'temp_file.jpg';
saveas(k, filename);
i1 = imread(filename);
delete(filename);
[x, y, rgb] = ind2sub([size(i1,1) size(i1,2) size(i1,3)], find(i1 ~= 255));
C = i1(min(x):max(x)-1,min(y):max(y)-1,:);
C = rgb2gray(C);
I = edge(C,'sobel');
I = imcrop(I,[10 7 920 725]);
I = imresize(I,[3250 3500]);
f=figure(3),imshow(I);
set(f, 'visible','off');
imwrite(I, filename);
bw = imread(filename);
delete(filename);
bw1 = bwareaopen(bw,750);
bwfill = imfill(bw1,'holes');
boundary = bwboundaries(bwfill);
figure(2),imshow(I),hold on;
[row1,dim]=size(boundary);
for k = 1:row1
x1= boundary{k};
h = plot(x1(:,2),x1(:,1),'c','LineWidth',1);
bw2 = bwconvhull(boundary{k});
[label,Total]=bwlabel(bw2);
measurements = regionprops(label,'Area');
allareas(k,1)= [measurements.Area];
end

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by