Inverse Perspective Mapping (newbie)

asked 2015-11-25 02:44:21 -0500

johnfulgor gravatar image

updated 2015-11-26 12:17:34 -0500

Hello all, I have a picture containing two geometric shapes on the same plane. The picure is taken from some unknown point of view. One shape is a square of know size, the other is unknown. Is it possible to revert the perspective transform, and measure the size of the unknown shapes? I am new to OpenCV, and I've only understood that this has to do with Inverse Perspective Mapping. What is the sequence of function calls? image description Thank you

I've tryed both affine and perspective transform, but the result is not what I want. The arch is still distorted, even if the square is not.

ORIGINAL

image description

AFFINE

image description

PERSPECTIVE

image description

Any idea?

edit retag flag offensive close merge delete

Comments

1

show your picture ;)

berak gravatar imageberak ( 2015-11-25 02:53:31 -0500 )edit

Are you looking for a tutorial?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-11-25 04:14:32 -0500 )edit

It is possible! You should detect the known object (threshold + find contours then find the approximation of the 2 quadrilaterals), do perspective transformation (with the 4 corners on scale you know), then detect the second object (unknown one) on the transformed image and do the calculus (based on ratios) to find its size

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-11-26 02:35:31 -0500 )edit

Is your arch always the same? Have you tried the features then perspective transformation, like here, and then do the correction of the image instead of detection of the arch? This should return the arch with no deformations. But then, you should see if the paper is the same, or the square...

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-11-27 02:46:52 -0500 )edit