Stroke Width Transform Error

Hi, I’m using the SWT function inside an image preprocessing pipeline I have in Python, and I’m finding that it is throwing some strange errors. The crash code is: Unknown C++ Exception. I also posted about this a few weeks ago.

When I input my images, if I have resized them more than around 2x, then it will crash maybe 1 in 5 times. If I don’t resize the images then it doesn’t seem to crash. It also seems to throw the error more often when the Dark_On_Light parameter is True while the actual image is light text on dark background.

The image np.array shape is (544, 704, 3), and the 2x is (1088, 1408, 3) and they are both uint8. This is consistent also for the images that throw the error.

This isn’t an issue for me, as I can just resize after SWT, but it might be worth looking into.

img = cv2.resize(img, None, fx=2, fy=2, interpolation=cv2.INTER_CUBIC)
rects, draw, chainBBs = cv2.text.detectTextSWT(img, True)

can you add at least 1 image to reproduce it ?