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:
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:
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
My guess is, that you could solve this with calculating the Orientation/Magnitude of the Image. But before trying that, read this. If your image looks exactly like what you show us as example, you should have values at the rectangle in the gradient and the Magnitude.