if it did not find any contours in your img, rect_min will contain invalid negative numbers, and submat will crash.
you'll have to add some logic, that cares for that.
Question
i have the following picture of which i want to crop out all letters in to new images.
The result of each letter should look like this for example:
I have had troubles achieving this, i have used thresholding, findContours, and many other things. I just cannot seem to cut out the letters since the image contains very much noise.
Can someone please provide some help and information?
Solution
if it did not find any contours in your img, rect_min will contain invalid negative numbers, and submat will crash.
you'll have to add some logic, that cares for that.