1 | initial version |
Would something like the following work?
Here are the steps for the images below.
convert the image to mono with cvtColor
use threshold with binary_inverse and a zero threshold value
use findContours with list and filter contours by area
From here you can get the remaining contour rectangle and extract/save this roi in the original image to a file.