straighten the jagged boundary and how to count lenght of boundary.

1 visualizzazione (ultimi 30 giorni)
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 :
  1 Commento
Ryan
Ryan il 17 Giu 2012
You have had more than enough help and examples given to you by this point that you should be able to figure out this out. Just find the perimeter, locate the corners and then calculate the distance between the corners.

Accedi per commentare.

Risposte (1)

Image Analyst
Image Analyst il 17 Giu 2012
I'm not sure I understand why you don't have this yet. I gave you a snippet of code that uses imtransform() to warp an image to make it rectangular. All you had to do was to find the corners, and I think I gave you hints for that.
For that matter, I'm not even sure why you need to do this at all when the problem could be completely avoided by having your camera directly overhead from your tile and a jig to ensure precise positioning of tile samples in the field of view. Why go through all this bother when you don't have to?
As far as the jaggies go, don't worry about them. You don't need to "straighten them out" - you just don't. Why do you think you do?
You could use regionprops() on the transformed image and calculate the length of the perimeter that way, or use bwboundaries() and use the Pythagorean theorem. I think the outer perimeter length would only vary if the tile were chipped or broken.
  10 Commenti
Walter Roberson
Walter Roberson il 19 Giu 2012
At the MATLAB command prompt, command
help corner
If it gives you help information then you can use that corner-finding routine to find the corners in your image.

Accedi per commentare.

Categorie

Scopri di più su Convert Image Type in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by