|
-
Jun 25th, 2003, 05:51 PM
#1
Thread Starter
Member
Using trig to convert x,y,r to x,y,z(please read for more details) RESOLVED
Ok, long story short:
I have a bunch of coordinates saved in a file. They are taken from a bunch of images taken of an object from various angles. I identified the edges, and saved the x coordinate, the y coordinates (of each point on an edge), and the angle the object was rotated to before taking this particular picture.
I need to convert those values to x,y,x values (for the edge points). You can assume the following things:
All the x,y values are from a plane pertindicular to and a given distance from the camera (about 5 inches).
Sorry, my description sucks. Please write back with any clarity questions you have.
Last edited by brian728s; Jun 26th, 2003 at 09:35 PM.
-
Jun 26th, 2003, 08:26 AM
#2
Not quite sure I quite understand what you mean.
You have rotated your camera an angle a and want to back rotate your coordinates as though they were coming from a picture taken without rotation, is that it?
For a pair of coordinates (x,y) taken after rotating the camera clockwise an angle a, the new unrotated coordinates (x',y') will be:
x' = x*cos(a) + y*sin(a)
y' = -x*sin(a) + y*cos(a)
-
Jun 26th, 2003, 01:25 PM
#3
Thread Starter
Member
Ok, I have a stationary camera. An object rotates on a platform in front of it.
The camera takes pictures from various angles. Then, my program finds the edge of the object in each frame.
Assuming all of the edge points came from one plane, it should be possible to figure out where in space each point on it is.
Imagine it like this:
You have a 3d space. Looking at it from above, you can see the edge of a vertical plane. That plane has some points on it. The plane is at at an angle (from above, the edge looks like a slanted line, the angle only affects x and y)
I need to know the x,y,z coordinates in that space of the points. I know where the points are on the plane (x,y) and I know what the angle between some point in the 3d world (the camera) and the plane.
I already know that Y in the picture becomes Z in the 3d model.
fY = Sin(Angle) * x
fX = y / Tan(Angle)
fZ = y
Would this work? (I thought of it at about 10 last night).
fy, fx, and fz are the new 3d coordinates. X, y and angle are the old one.
I think something is wrong, but I can't figure it out.
-
Jun 26th, 2003, 02:09 PM
#4
Thread Starter
Member
I just simplified it even more. Ok, I just can't concentrate.
Take a right triangle. Draw it on your piece of paper. The right angle should be at the bottom left.
Of the non-hypotenuse sides, the one on the left is fY, the one on the bottom is fX.
The length of the hypotenuse is original x value. The angle between fX and X is the, well, angle.
Can someone better at trig solve the triangle for me.
-
Jun 26th, 2003, 09:35 PM
#5
Thread Starter
Member
fX = y / Tan(Angle)
should be fX = fY / Tan(Angle)
I fixed it, thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|