Reputation: 484
I am having issue with opencv's Sobel edge detector. From its documentation it seems to work only for horizontal and vertical direction edges (by specifying 0,1 or 1,0). Has anyone got idea how to get the diagonal edges 45deg and 135deg with cvSobel (not Canny methods). Matlab has a soultion with its edge(I,'sobel' ...) option, but my code is all in c++ and I would like to keep it as such.
Thanks for suggestions and solutions.
Upvotes: 4
Views: 4618
Reputation: 6615
It does detect diagonals. You just run it twice. A point that is both horizontal and vertical is, by definition, diagonal.
Upvotes: 0
Reputation: 4453
Hei. You can generally calculate any filter in any direction in the following way:
This works for edge detection, motion blur and any linear directed filter.
Upvotes: 5