neezra
11-12-2011, 03:27 AM
hi all,
I'm doing my graphic project that uses both opengl and opencv.
I have done doing the opencv part that is to track hand movement by finding the center of the hand that appear in front of the camera (lets just call it a blob).
from there, I will get the center of the blob.
now, i want to make the 3D model in opengl move according to the center the blob from my opencv program.
the problem is when I combine both coding in one program,
only one of them will function.
example:
1. both opencv and opengl window will appear, but image captured from the camera did not move.
2. my opencv program running smoothly but when I hit 'esc' button, opengl window will appear and my opencv program stop running.
When I gone through the code, I think the glutMainLoop() function is the caused of this problem. but I don't know how to fix it.
can someone help me?
this is the structure of my code.
--declaration--
int main()
{
<preprocessing>
initializing opengl 3D model
while(not 'esc')
{
- opencv process to detect hand movement.
- get the center of the blob
- update the position of the 3D model
}
glutMainLoop()
}
thank you.
I'm doing my graphic project that uses both opengl and opencv.
I have done doing the opencv part that is to track hand movement by finding the center of the hand that appear in front of the camera (lets just call it a blob).
from there, I will get the center of the blob.
now, i want to make the 3D model in opengl move according to the center the blob from my opencv program.
the problem is when I combine both coding in one program,
only one of them will function.
example:
1. both opencv and opengl window will appear, but image captured from the camera did not move.
2. my opencv program running smoothly but when I hit 'esc' button, opengl window will appear and my opencv program stop running.
When I gone through the code, I think the glutMainLoop() function is the caused of this problem. but I don't know how to fix it.
can someone help me?
this is the structure of my code.
--declaration--
int main()
{
<preprocessing>
initializing opengl 3D model
while(not 'esc')
{
- opencv process to detect hand movement.
- get the center of the blob
- update the position of the 3D model
}
glutMainLoop()
}
thank you.