i am doing a gradient diffusion to extract the skeleton:
I am computing the gradient orientation: atan2(Dy,Dx). and i want to normilse it between 0 and pi.
how can i normilise it?? i am not getting good results. i tried mod(direction,pi) but i am not sure if it's the right way to do it.
source code + image test1.png the *.m files are *.txt and the main file is skeletonize.m(txt)
thank you!
show.zip
could you use atan2(Dy,Dx) for Dy > 0 and atan2(-Dy,-Dx) for Dy < 0