how to find the midpoint in between end point and branch point

4 views (last 30 days)
i am working on hand written word images, i want to represent the word image in the form of graph. i want to find the mid points in between two key points and two branch points
  3 Comments
Raghu Rao
Raghu Rao on 24 Mar 2017
Edited: Raghu Rao on 24 Mar 2017
this is my output image, i already find out the end points and branch points but my problems is i want to add a node in between two end points and branch points

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 24 Mar 2017
I'd think taking the average of the x and y values for each endpoint would do it:
xMiddle = (x1+x2)/2;
yMiddle = (y1+y2)/2;
or am I overlooking something?
  3 Comments
Nehal Ahmad
Nehal Ahmad on 12 Dec 2019
Could you please share the code part of this branching points?
Image Analyst
Image Analyst on 12 Dec 2019
Look at bwmorph()
epImage = bwmorph(skeletonImage, 'EndPoints');
bpImage = bwmorph(skeletonImage, 'BranchPoints');
[epRows, epColumns] = find(epImage); % Get location of end points.
hold on;
plot(epColumns, epRows, 'r.', 'MarkerSize', 30);
[bpRows, bpColumns] = find(bpImage); % Get location of branch points.
plot(bpColumns, bpRows, 'ro', 'MarkerSize', 40);

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!