How to make traversal in an image and change color of the specified pixels along the path by some criteria, for example in my image i shown as under, I want to place after each five pixels a white pixel in an image.?

1 view (last 30 days)
  5 Comments
Mohammad Bhat
Mohammad Bhat on 18 Nov 2017
hi, Actually I want to extract underlying graph from handwritten word image.As shown in figure , i have extracted branch and end points. To represent whole image in an exact manner, I want to add nodes or after regular intervals along the path.So that we get better reprentation intetms of nodes.
Mohammad Bhat
Mohammad Bhat on 18 Nov 2017
1. find start and end points. 2. find branch or junction points. 3. add nodes along the path. 4. then add edges along the path.
Image is binarised and thinned by using bwmorph command of matlab..

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 19 Nov 2017
I think you want bwmorph() with the 'endpoints' and 'branchpoints' options.
  3 Comments
Image Analyst
Image Analyst on 19 Nov 2017
Why? You can subtract branchpoints from the original image to break it apart into segments. Then you'd have to write some custom code to "traverse" each segment but I see no reason to do this. Good luck on writing that code though.
Mohammad Bhat
Mohammad Bhat on 19 Nov 2017
here is algo which I want to implement:- 1. For each connected component 2. find junction points 3. invert junction points 4. For each connected sub-component 5. Find start and end points 6. add nodes along the path 7. replace neighbours of junction point 8. add edges based on skeleton. ----------------------------------------- image is filtered,binarised character image let us say small character 'e'...

Sign in to comment.

More Answers (2)

Walter Roberson
Walter Roberson on 18 Nov 2017
  12 Comments
Mohammad Bhat
Mohammad Bhat on 19 Nov 2017
I have extracted branch and end points of a binary handwritten image of letter 'e' . Between every points (branch and end ) I have to place atleast two or three nodes more, inorder to represent it more accurately....
Image Analyst
Image Analyst on 19 Nov 2017
You can remove the branchpoints to break apart the blobs. Then use regionprops() and ask for PixelIdxList to get the linear indexes or PixelList to get a list of (x,y) coordinates of pixels in the blob. This may not give pixels in the exact order - it probably does for linear shapes but you'd have to check for blobs that loop back, like a C shape.

Sign in to comment.


Mohammad Bhat
Mohammad Bhat on 19 Nov 2017
If we have some code to begin with....If we try letter e...

Community Treasure Hunt

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

Start Hunting!