Lets say I have the following image where there is a folder image with a white label on it. What I want is to detect the coordinates of end points of the folder and the white paper on it (both rectangles). Using the coordinates, I want to know the exact place of the paper on the folder.
GIVEN : The inner white paper rectangle is always going to be of the fixed size, so may be we can use this knowledge somewhere?
I am new to opencv and trying to find some guidance around how should I approach this problem?
Problem Statement : We cannot rely on color based solution since this is just an example and color of both the folder as well as the rectangular paper can change. There can be other noisy papers too but one thing is given, The overall folder and the big rectangular paper would always be the biggest two rectangles at any given time.
I have tried opencv canny for edge detection and it looks like this image.
Now how can I find the coordinates of outer rectangle and inner rectangle.