How I can find the coordinates of the pixels ?

3 views (last 30 days)
Asifa
Asifa on 18 Sep 2014
Commented: Image Analyst on 28 Sep 2014
I want to find the coordinates of pixels that are connected together in a thinned image making some path. For example as in Urdu language the coordinates of the thinned image of alphabet Bay,pay or jeem etc...if i use [x,y]=find(image) function it gives the coordinates values of thinned image but not in a sequence. It scans from left to right and top to bottom.but i want coordinates of path in sequence. If anyone can help i will b very thankful.
  2 Comments
Rushikesh Tade
Rushikesh Tade on 27 Sep 2014
If you could post an image on which you are working and tell us what kind of path/output coordinates you expect, may be that would help to understand your problem.
Asifa
Asifa on 28 Sep 2014
This is one of the image of alphabet on which I am working.i want the image pixel coordinates in sequence that is basically path. In this image I require coordinates from top left to bottom right following the path..when I was able to find that then use these values for robot to trace the same path.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 18 Sep 2014
Skeletonize your binary image with skelImage = bwmorph(binaryImage, 'skel', inf). Then use
[rows, columns] = find(skelImage);
to get the coordinates.
  4 Comments
Image Analyst
Image Analyst on 27 Sep 2014
There is no one, right "sequence" for some arbitrary scribble with lots of crossings. The robot could draw that in lots of ways, some with more picking up of the pen than others. Probably the most straight forward way is to use bwmorph() to find crossing points and break the pattern up into a bunch of single pixel wide curves. Then draw those. Then go back and put "dots" where each crossing point was. Obviously it's not the way people would draw the character but it will work.
Image Analyst
Image Analyst on 28 Sep 2014
I think one way to do it is to have predefined paths for all characters. Then you do OCR on the image and figure out what characters are there. Then have the robot draw those with the nominal, predefined paths. It won't exactly follow the image and make an exact duplicate of what's in the image but would make a "perfect" version of it. I think that should be okay don't you? If not, then what about my prior suggestion about removing crossing points? Surely one of them should be acceptable .

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!