like below fixes the issue I am looking for a bit of clarification on how the algorithms implemented in Canny edge detection - Wikipedia entry - work. It seems pretty straightforward to perform noise reduction using a 2D Gaussian filter, but I have heard that using two 1D filters - how is this accomplished? It's also simple to calculate the gradient and edge direction. However, when performing non-maximum suppression is there a neat trick to getting the rounded angle? What I'm currently doing is dividing the edge direction (theta) value by pi/4, casting it to an integer and using a switch statement. But, how does one handle the negative theta values - ie should -pi/4 be handled the same way as 3*pi/4 or the same as pi/4? , Gauss distribution: [constants are omitted for simplicity]
Canny edge detector for Android -- StackOverflow on recursive function
With these it helps Android's default thread stack is much smaller than what you get on a desktop. In current Android builds (2.3), the stack size is set to 12kB I believe. Your recursion is simply too deep.
Fast Adaptive Threshold for Canny Edge Detector in Android