Finding Distance Between Lines

7 visualizzazioni (ultimi 30 giorni)
Cy
Cy il 21 Gen 2015
Modificato: Cy il 22 Gen 2015
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.

Risposte (2)

Image Analyst
Image Analyst il 21 Gen 2015
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 Commenti
Image Analyst
Image Analyst il 22 Gen 2015
Modificato: Image Analyst il 22 Gen 2015
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?
Cy
Cy il 22 Gen 2015
Modificato: Cy il 22 Gen 2015
Yes, I have access to the Signal Processing Toolbox. From the findpeaks() functions, do I just need to find the maximum values from peak to peak in order to find the distance?

Accedi per commentare.


sukuchha shrestha
sukuchha shrestha il 22 Gen 2015
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

Community Treasure Hunt

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

Start Hunting!

Translated by