0
votes

I only have projection and model-view matrices while what I want is getting the 2D position of object in the screen. The projection matrix is array of float[16]. For example:

float[] projectionMatrix = new float[16] {
    2.6077228, 0.0, 0.0, 0.0,
    0.0, 1.9605954, 0.0, 0.0,
    -0.010504603, -0.01849866, -1.004008, -1.0,
    0.0, 0.0, -20.040081, 0.0
};

The model-view matrix is the same. For example:

float[] modelViewMatrix = new float[16] {
    0.78095937, -0.05827314, -0.6218487, 0.0,
    0.04460156, 0.9982925, -0.037790783, 0.0,
    0.6229988, 0.001786924, 0.78222054, 0.0,
    25.339212, -41.582745, -197.50203, 1.0
}

How to find the final position of object [x, y]? Does anyone have experience in this?

Update more details: In my project, everything is calculated inside .so lib. I can only get the projection and modelview matrx. The lib detects an object via camera and now I want to know the 2d position of it on the screen to add some touch events.

1
Multiply the vector first with the modelViewMatrix, then with the projectionMatrix. If that doesn't work, you'll have to be more specify about where exactly you're having problems.Reto Koradi
Hi Reto, in my project, everything is calculated inside .so lib. I can only get the projection and modelview matrx. The lib detects an object via camera and now I want to know the 2d position of it on the screen to add some touch events.Quan Nguyen

1 Answers

0
votes

I have experience on this area.

What you are doing is multiplying to vector object other-way ,(i.e) you are correlating the two image data. it is nothing but, correlation based object detection.Open GL E.S 2.0 will not allow to read the shader variable.

Output of the RGB data (LCD interface) will contain the ROW count (Hsync) and COLUMN count (pixel count) provides you the object position if you assign the pixel when the correlation is successful

How much FPS you are getting?

All the best.