Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Extract area inside rectangle

Hey,

i have some Bitmaps in an Android App which always contain some kind of rectangle in the right part of the image. The rectangle is not fully closed tho. Inside this rectangle theres some numbers. Basically i want to delete everything in that image except for the part inside the rectangle.

Example image: Input

Now i would like to detect the rectangle on the right and just keep the stuff inside it. So basically just the things inside the red box: Output

Since im new to OpenCV i dont really have an idea whats the best way of doing this. Maybe its important to say, that the images can also be slighty rotated so the rectangle is not always perfect horizontally or at the exact same spot.

Hope you can give me some tips how to accomplish this. Best regards