Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - oliw

#1
As far as I know, the coordinate system in OpenCV is the same as JPCT. In OpenCV X points to the right, Y points down and Z points into the screen. This implies I shouldn't have to change between coordinate systems?

I've followed your advice. I've taken my 4x4 Pose from OpenCV

r1 r2 r3 t1
r4 r5 r6 t2
r7 r8 r9 t3
0  0  0   1

and split them into a JPCT Matrix and JPCT SimpleVector
i.e.

cameraRotation
r1 r2 r3 0
r4 r5 r6 0
r7 r8 r9 0
0  0  0   1

and

cameraTranslation
t1
t2
t3

then I do

camera.setPosition(cameraTranslation);
camera.setBack(cameraRotation);

Does this make sense? (I still can't see my expected result but it COULD be an earlier mistake I make in OpenCV)
#2
I have a question to do with building an Augmented Reality app using JPCT (and OpenCV) which places graphics over planar book covers.

Imagine this scenario.

I have a planar rectangle in my scene. The center of the rectangle is at world coordinate (0,0,0).

I have used OpenCV solvePNP to get a 4x4 Matrix containing a transformation (comprised of a translation and a rotation) from the world/model's coordinate system (they are the same) to where the camera should be placed.

My question is:
Where should my camera initially be placed and pointed in the world coordinate system and...
How should I then apply the 4x4 transformation to move and reorient the camera from its initial position and orientation so that it is in its the right position and orientation?

I should add that I am just rendering a primitive sphere at the origin for now.

Let me know if I should clarify! (I am a graphics novice)
Thanks in advance
Oli