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 次查看(过去 30 天)
  5 个评论
Mohammad Bhat
Mohammad Bhat 2017-11-18
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 2017-11-18
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..

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2017-11-19
I think you want bwmorph() with the 'endpoints' and 'branchpoints' options.
  3 个评论
Image Analyst
Image Analyst 2017-11-19
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 2017-11-19
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'...

请先登录,再进行评论。

更多回答(2 个)

Walter Roberson
Walter Roberson 2017-11-18
  12 个评论
Mohammad Bhat
Mohammad Bhat 2017-11-19
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 2017-11-19
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.

请先登录,再进行评论。


Mohammad Bhat
Mohammad Bhat 2017-11-19
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!

Translated by