fdcl-gwu / aruco-markers

Working examples/tutorial for detection and pose estimation of ArUco markers with C++, including instructions to build and install OpenCV from source.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenGL Request

tr0ublee opened this issue · comments

commented

Hello, thanks for the sample codes. They really helped me a lot. I am looking for a way to make drawing stuff with OpenGL on markers. Do you know any tutorials, or do you know how to do this ? Thanks in advance.

commented

Hello again,
thanks for the reply. Actually, I have a Python script that draws a cube on aruco markers using OpenGL. I will also code it on C++, but there is one issue. Whenever I move the camera, the cube also moves with the camera. If I can sort that out, I guess it will be done. Is there any chance that you happen to know what causes this ? Btw cube never leaves marker but still it moves with camera (i.e, cube moves on aruco marker).

I am not entirely sure about the reason or what you mean when you say "cube moves on aruco marker". One possible reason would be the origin of the cube. If you need the cube to be on the marker, the origin of the cube must be on the bottom most face.

In other words, if you are drawing a unit cube, the (x,y,z) coordinates must be as follows:
(1, 1, 1)
(1, -1, 1)
(-1, -1, 1)
(-1, 1, 1)
(1, 1, 0)
(1, -1, 0)
(-1, -1, 0)
(-1, 1, 0)

If this is correct, I am not sure what is wrong with your code.

commented

Actually it is not my code. I found the code on stackoverflow and thought it would give me some idea about the process. So, I took the code and run it on my computer. When marker is at the center, cube is drawn on it. But when I move the marker to the right for example, cube also moves to the right but it is no longer on marker. I tried the solution mentioned in the comment but didnt work. Can you have a look at the code and tell what is wrong with it? Btw, of course my problem is the same with the guy's problem who posted the code. Link to code
https://stackoverflow.com/questions/50764623/object-is-wrong-displaced-in-ar-aruco-opengl