Finding Distance Between Lines
이전 댓글 표시
Hi All, I am trying to learn how to process images in Matlab. I am trying to find the horizontal/vertical distance from the outer edge of the major gridline to other outer edge of the major gridline. The major gridlines are spaced 1" apart. I have attached some graph paper for visualization. I have a few questions as to how to start the process. Do I need to convert the image to binary in order to find the edges? How would I determine the exact edge of the gridline? How can I get the count of the pixels between these two edges?
Any guidance would be greatly appreciated to get me started in the right direction.
Thanks!
Added a PNG file.
답변 (2개)
Image Analyst
2015년 1월 21일
Get profiles and look at full width at half max
verticalProfile = sum(grayImage, 2);
horizontalProfile = sum(grayImage, 1);
subplot(2,1,1);
plot(verticalProfile);
subplot(2,1,2);
plot(horizontalProfile);
댓글 수: 5
Cy
2015년 1월 21일
Image Analyst
2015년 1월 22일
Did you try what I said? I can't really try it since you put your image into a PDF document instead of uploading the image file itself. Just look at the profile and use find() to find out where it exceeds half the max value and subtract the indexes. I think it will be obvious once you see the plots.
Cy
2015년 1월 22일
Image Analyst
2015년 1월 22일
편집: Image Analyst
2015년 1월 22일
I'll look at it later this morning. In the meantime, do you have a PNG, BMP, or TIFF file? JPG files are not good for image analysis because of the jpeg artifacts like block artifacts and blurring. It's easier to go from center to center - you can use findpeaks() in the Signal Processing Toolbox. Is that okay? Do you have that toolbox?
sukuchha shrestha
2015년 1월 22일
0 개 추천
use thresholding to get major grid lines run with horizontal line structuring element to get vertical major grids ( imgV) run with vertical line structuring element to get horizonal major grids(imgH) label imgV and get minX, minY for every blobs compute distance ( x-x)2+(y-y)2
카테고리
도움말 센터 및 File Exchange에서 Descriptive Statistics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!