Crack Detection
8 次查看(过去 30 天)
显示 更早的评论
I have problem for detection for surface ceramics image, how i can detect crack surface , pls give me some advice. this my code for detect crack surface
function [img1_array, img2_array,img3_array, img4_array,Zme]= DefectScan(input_path,input_path2);
% clear all;
% close all;
I = imread(input_path2);
J = imread(input_path);
I = rgb2gray(I);
J = rgb2gray(J);
% f=figure,imshow(I);
% g=figure,imshow(J);
hy = fspecial('sobel');
hx = hy';
Iy = imfilter(double(I), hy, 'replicate');
Ix = imfilter(double(I), hx, 'replicate');
ey = fspecial('sobel');
fx = ey';
Jy = imfilter(double(J), ey, 'replicate');
Jx = imfilter(double(J), fx, 'replicate');
gradmag = sqrt(Ix.^2 + Iy.^2);
gradmag2 = sqrt(Jx.^2 + Jy.^2);
K=figure,imshow(gradmag,[]);
L=figure,imshow(gradmag2,[]);
set(K, 'visible','off');
set(L, 'visible','off');
filename = 'temp_file.jpg'
filename2 = 'temp_file2.jpg'
saveas(K, filename)
saveas(L, filename2)
i1 = imread(filename)
i2 = imread(filename2)
delete(filename)
delete(filename2)
[x, y, rgb] = ind2sub([size(i1,1) size(i1,2) size(i1,3)], find(i1 ~= 255));
A = i1(min(x):max(x)-1,min(y):max(y)-1,:);
[x, y, rgb] = ind2sub([size(i2,1) size(i2,2) size(i2,3)], find(i2 ~= 255));
B = i2(min(x):max(x)-1,min(y):max(y)-1,:);
A = rgb2gray(A)
B = rgb2gray(B)
I = edge(A,'sobel')
J = edge(B,'sobel')
3 个评论
回答(4 个)
Dio Donaika
2012-6-16
5 个评论
Walter Roberson
2012-6-16
I see some slanted lines that are fairly straight, but those look to me like scratches rather than cracks.
I see a number of areas that are raised, but possibly the places that appear lower are instead filled with something that is optically transparent and the tile overall has a flat surface.
Could you perhaps post the images 1 and 2 again, with cracks pointed out with marks?
Image Analyst
2012-7-22
"What do i do next to calculate crack in centimeter ?" Well, what is the size of your field of view in cm? Let's say it's 30 cm and your image width is 1000 pixels. Then your calibration factor is 30/1000 cm per linear pixel, or 30^2/1000^2 cm^2 per pixel area. So just multiply your pixel lengths or areas by those factors to get the results in cm or cm^2.
8 个评论
Sarhat
2012-11-29
Hello
I have used your algorithm for Crack detection in the pavement but doesn't helped. I have made an algorithm for detection of crack based on sobel edge detection. the problem, there are lots of false positive which I want to remove and only remain the edges belong to cracks.
Regards
1 个评论
Image Analyst
2012-11-29
I don't see a question. If you have a question on MATLAB programming, you can start your own thread. But we give a lot more help on MATLAB programming and some, but not so much, on algorithm development.
vijendra sn
2014-8-12
Hi Dio,
I am using your code for my project work. I am not able identify the dent in the image which i have attached. Please can u help out in this regards
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mathematics and Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!