I'm trying to implement the Stroke Width Transform in Python. I have gone through numerous stack overflow questions and answers and other resources on the internet but have not found an implementation for it. So I decided to try on my own.
After performing Canny edge detection, my first step is to calculate the x and y derivatives of the image
sobelx = cv2.Sobel(img,cv2.CV_64F,1,0,ksize=5)
sobely = cv2.Sobel(img,cv2.CV_64F,0,1,ksize=5)
How do I then combine these to get the gradient at each point in the image? Also, how do I then calculate the width of the stroke?
I'm using the steps given in the original IEEE Paper (freely accessible paper direct from Microsoft here) for reference. The description of the steps is on the bottom of the right hand side on page 3.