How can in find minimum gradient path with respect to the reference point in a text image?

I have a signature image. I managed to find the starting point of the image. Now i want to trace all the points of the signature in a connected manner and find the distance of each point from the refernce point. Firstly i have skeletonize the image and performed the operations using 3*3 window it is take lots of time and the results are also not perfect. please suggest the methods how can i do this in matlab. I thought of applying minimum gradient but not able to figure out how can i apply this. I have attatched the signature image along with the question.

Antworten (1)

Matt J
Matt J am 5 Jul. 2019
Bearbeitet: Matt J am 5 Jul. 2019
You can use bwskel or bwmorph('thin',...) to do the skeletonization. If you are already using this, I don't know why it would be slow, but on the other hand, I don't know what you consider fast. Also, bwmorph supports gpuArrays, so if you have the Parallel Computing Toolbox, that could be used to gain extra speed.

6 Kommentare

hello, thank you for your answer. I ahve already skeletonize the image. my objective now is to traverse the signature image and find the distance of each point from the reference point.
That seems as simple as
[I,J]=find(skeleton);
distances = sqrt( (I-refpoint(1)).^2 +(J-refpoint(2)).^2 )
my objective is quite different. i want to trace the whole signature in a connected manner starting form the starting point of the signature. like i started from the starting point the distance between these two [points will be zero. now i will head to the next connected point and find the distance and so on.
So you mean, what I gave you is correct except that the distances are in the wrong order?
But then, how are you going to traverse the signature points in some successive order when some of the letters (like "I") cannot be written in a single pen stroke? When you reach a branch point of the signature skeleton, which branch will you take, and what will the rule be for when to backtrack to get the other branches?
i will store those points for backtracking. this is what i think. if you hav any better alternative then please suggest me.
Well, here's a good place to start, I think:
C=bwboundaries(skeleton);
for i=1:numel(C)
C{i}=unique(C{i},'stable','rows');
end
This will give the pixels of the skeleton in some neighbor-to-neighbor ordering chosen by the software. You can see if this ordering is adjustable to your needs.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 5 Jul. 2019

Bearbeitet:

am 5 Jul. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by