How can find area of the dent detected?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
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
by which method you have found dent?
Image Analyst
2021년 10월 12일
@Samadhan Kshirsagar, he gave the code below in his answer:
Did you scroll down and see it?
채택된 답변
Image Analyst
2014년 9월 3일
0 개 추천
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
Dent Detection in Car Bodies,
ICPR00(Vol IV: 775-778).
IEEE via DOI 0009
Structured light. BibRef
TITLE = "Dent Detection in Car Bodies",
BOOKTITLE = ICPR00,
YEAR = "2000",
PAGES = "Vol IV: 775-778",
BIBSOURCE = "http://www.visionbib.com/bibliography/applicat839.html#TT113769"}
Just call regionprops() if you've already segmented the dents
labeledImage = bwlabel(dentBinaryImage);
measurements = regionprops(labeledImage, 'Area');
allAreas = [measurements.Area]
vijendra sn
2014년 9월 10일
I want to find out area in millimeter or centimeter..how to find out.

Here is my code;
A = imread('DSC_0252.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,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); figure,imshow(C); I = edge(C,'sobel');
I = imcrop(I,[10 7 920 725]); I = imresize(I, [3500 3700]);
f=figure,imshow(I); set(f, 'visible','off'); imwrite(I, filename);
bw = imread(filename); delete(filename);
bw1 = bwareaopen(bw,1100); bwfill=imfill(bw1,'holes'); boundary=bwboundaries(bwfill);
figure,imshow(I),hold on;
[row1,dim]=size(boundary);
for k=1:row1 x1=boundary{k}; h=plot(x1(:,2),x1(:,1),'c','LineWidth',1); end
labeledImage = bwlabel(bw1); measurements = regionprops(labeledImage, 'Area'); allAreas = [measurements.Area]
Image Analyst
2014년 9월 10일
Did you get the article yet? Are you going to?
The best method is to use profilometry to get actual topographic information. For example an instrument from GFM http://www.gfm3d.com/index.php?option=com_content&id=65%3Amikrocad&lang=en
I don't think your method is that good or robust. It depends on the size being large, so it can't measure small dents. I didn't run it but I don't see imconvhull() being called and since there is only an edge on one side of the dent, the side with the ramp won't be included. Keep working on it though. As you can imagine once you have a robust program it will probably be hundreds if not thousands of lines long.
I don't know how to use imconvhull() as i don't have image processing tool box
k=figure,imshow(gradmag,[]);
set(k, 'visible','off');
filename = 'temp_file.jpg';
saveas(k, filename);
i1 = imread(filename);
delete(filename);
In this small code, i am saving the image and reading the image again.I don't want to save and read as it takes too much time for processing. Is there any method to develop....
Image Analyst
2014년 9월 11일
I don't know why you want i1 to be a screenshot. What are you going to do with a screenshot of the figure? What good is that instead of the actual image that is displayed in the figure? Get the Image Processing Toolbox. You really don't want to rewrite it yourself and there are too many useful functions in there for getting boundaries, making measurements, doing size filtering and connected components labeling, displaying images, etc.
vijendra sn
2014년 9월 12일
Hi,
I am not getting the correct functions. can u tell me, how to code for above small code
Isn't "allAreas" the areas that you're looking for? Remember to do
bw1 = bwconvull(bw1);
like I suggested before you label the image.
i am getting error for this code:
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 3700]);
f=figure(3),imshow(I);
set(f, 'visible','off');
imwrite(I, filename);
bw = imread(filename);
delete(filename);
bw1 = bwareaopen(bw,1500);
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);
end
bw1 = bwconvull(bw1);
labeledImage = bwlabel(bw1);
measurements = regionprops(labeledImage,'Area');
allAreas = [measurements.Area];
ERROR IS: Undefined function or method 'bwconvull' for input arguments of type 'logical'
Image Analyst
2014년 9월 12일
Well how old is your version? bwconvhull() is several years old but if you have an antique version, then you may not have that function and should upgrade.
vijendra sn
2014년 9월 15일
편집: Image Analyst
2014년 9월 15일
My Matlab version is 7.10.0.499(2010a).
Image Analyst
2014년 9월 15일
Please upgrade. What happens when you say "which bwconvhull"?
추가 답변 (1개)
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

카테고리
도움말 센터 및 File Exchange에서 Biotech and Pharmaceutical에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
