- Start by doing corner detection
- Calculate the difference in slopes between the top and bottom edges (by using the coordinates of the corners), and also calculate the difference in slopes between the right and left edges. Choose the line pair with the least difference in slope and use that line pair as your reference pair.
- You could rotate the image so that one of the two lines of the reference pair is along the y-axis, with the other of the reference pair forming the top and ideally the top would then be parallel to the bottom. You do not actually need to do the rotation though, as you can proceed analytically just based upon coordinates
- Once you have a logical bottom line and top line, by looking at the difference in projected x coordinates of the "top" corners vs the "bottom" corners, you can easily calculate the length of the small side of the triangles. By looking at the difference in projected y coordinates of the "top" line vs the bottom line, you can easily calculate the length of the larger side of the triangles.
- Now do some trivial geometry to calculate the length of the two hypotenuse.
- None of this requires that you do any light equalization or any image rotation or any cropping: all it requires is that you can do corner detection and a small amount of geometry, and requires that the sides be a sufficiently close approximation of straight for simple geometry to be accurate enough.
- The above also assumes that there is no "preferred" direction for the tile; if there is the equivalent of a "grain" that must be detected and is preferred to run either top to bottom or side to side, then you would need additional work to do that detection.
how solve this problem - Edge detection, straighten the line detection, and counting the line of edge image
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I want to find the edge of a line image, but If i detect with canny and sobel, thats not suitable, not straight but the problem is the line still irregular lines,,, I NEED M-FILE CODING : How to straighten out the jagged lines on the edges and calculate the length of the edge :
0 Commenti
Risposte (2)
Walter Roberson
il 14 Giu 2012
2 Commenti
Walter Roberson
il 14 Giu 2012
In theory I could give the implementation. In practice, it's more enjoyable to keep re-reading The Dresden Files.
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!