Orientation/directional image

Started by
-1 comments, last by Ructions 19 years, 4 months ago
I was wondering how to make a directional image. I know the concepts like finding the gradiant using sobel to find gradient in x and y direction. I also found a formula to puts these values into and get a result. but it doesnt work. i dont really understand why. The steps i have followed is find the gradient in the x and y using sobel and placing these values into 2 seperate 2 dimential arrays. each array position corresponding to the position in the image where the value comes from. Then for each 17x17 block i use the formula = 90 + 1/2 arctan(2Gxy/Gxx-Gyy) where Gxy is the value of the gradient of x and y multiplied together for all 17x17 pixels. Gxx is the gradient of x squared for all 17x17 pixels Gyy is the gradient of y squared for all 17x17 pixels. But this is not working for me and dont know why. for some reason the angle that comes out is most always infinite. Any help would be greatly appriciated. Some code examples would be greatful aswell. Thanks a millions Thanks Ructions

This topic is closed to new replies.

Advertisement