I am very new to using opencv in this way.
I have two vouchers as seen below. I ultimately want to be able to extract only the text with numbers from the vouchers. I am able to extract the text after "manually" cropping the captured image.
.
I would like to be able to automatically, crop the images such that the RIO of interest is bounded as seen below.
.
I thought I would be able to crop by color (I do not know the code but will eventually figure it out, I hope), that would however work only for the second of the two and fail for the first one as it has a lot of white spaces.
I then thought of searching for shapes (I do not know the code but will eventually figure it out, I hope), that would work work for the first voucher as it has a "gray box" around it, it will however fail for the second one as no such box exists for the second one. Any advice on how I may go around AUTOMATICALLY bounding my ROI to only the "boxed areas". I want to be able to detect the text from the ROI, which I am so far able to do, I however want to remove the need for the user to have to crop the image to designate the RIO instead do that automatically.
I am doing this on android studio.