Google Answers Logo
View Question
 
Q: 2D transformation ( No Answer,   1 Comment )
Question  
Subject: 2D transformation
Category: Computers
Asked by: keithc-ga
List Price: $20.00
Posted: 03 Jun 2005 20:22 PDT
Expires: 06 Jun 2005 07:41 PDT
Question ID: 529162
I have a camera pointed at a rectangular 2D area.  The camera is off
center (say high and to the right) so that the rectangle appears
distorted to the camera.

I detect a point within the rectangle with the camera.

How do I translate the coordinates I'm seeing in the camera to the
"real" coordinates that the point represents on the rectangle?

I can get calibration data points for the 4 corners of the rectangle
in the camera (or any other points on the rectangle if the math is
easier):

For Example
Here's some actual test data from the camera:
The camera "sees" the four corners of my rectangle as:
261,54     540,60

280,258    534,319

It then read the center point as 386,176

The 4 points that are halfway from the middle of the rectangle to the corners were:
322,113     456,124

329,220     456,245

To map this back to the "real" rectangle that is, say, 400x300 I would
want to transform these sample data points to, roughly:
center: 200,150
halfway to corners: 100,75  300,75   100,225   300,225

What I'm hoping to get is a simple algorithm or formula(s) for taking
calibration readings I get for the corner points (which I can control)
and transforming any future reading I take in the space into it's
"real" coordinates on the rectangle.

Any help would be much appreciated.

To the extent this involves any libraries, I'm using the .net environment.

Thanks!

Clarification of Question by keithc-ga on 04 Jun 2005 16:11 PDT
Thanks for taking a look at this!

Just to clarify, all the readings I gave were measured results.  

For instance, I placed objects in the corners and the middle of the
rectangle and the data came back as listed in the question.

What I'm trying to do is figure out how I would *calculate* from an
x,y coordinate I see in the camera to determine where it was on the
"real" rectangle if I didn't know.

So if I got the reading 386,176 how would I calculate that that is
200,150 on the real rectangle if I didn't already know it?

Thanks!

Clarification of Question by keithc-ga on 04 Jun 2005 18:02 PDT
SIMPLIFICATION:

Let me boil this down to the core question:

If I have skewed space 1 with corners:
261,54     540,60

280,258    534,319

And I want to map that a rectangle 2 with corners
0,0        400,0

300,0      400,300

What is the formula for taking a point in space 1 and determining what
point it would map to in rectangle 2?

What is the generalized formula for solving this class of problems?

As an example, I would expect the point 386,176 in space 1 to map to
200,150 in rectangle 2.
Answer  
There is no answer at this time.

Comments  
Subject: Re: 2D transformation
From: redhoss-ga on 04 Jun 2005 06:45 PDT
 
Just out of curiosity I did a layout of your problem in CAD. For the
center point where you have 386,176, I get 387.12,176.42 for the same
point. I don't know how you got your center point coordinates, but
they are pretty close. I suppose you could do a CAD layout each time
you need a solution.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy