| ARToolKit | Mailing List Archive |
|
| From: | Arvind Lakshmikumar <kla@c .........> | Received: | Feb 17, 2003 |
| To | artoolkit@h .................. | ||
| Subject: | Displaying camera images twice | ||
Folks,
I have a small problem with the camera initialization..I guess I posed
this question in a different way and haven't been too clear..I've included
the code fragment below..
I have 2 functions, both which need to call the camera display routines.
After I load one, how do I change control from one function to another..
Thanks a lot,
regards,
Arvind
*******************************************************************
void CGUIDlg::OnButton1LoadImage()
{
// TODO: Add your control notification handler code here
CoInitialize(NULL);
//initialize applications
init();
//start the video capture
camera.Init(0,xsize,ysize);
camera.SetFlippedImage(true);
argMainLoop(NULL,keyEvent,show);
/* get ready to grab a new video frame */
argSwapBuffers();
CoUninitialize();
}
void CGUIDlg::OnButton2Track()
{
// TODO: Add your control notification handler code here
ARUint8 *dataPtr;
ARMarkerInfo *marker_info;
int marker_num;
int j, k;
/* get ready to grab a new video frame */
//argSwapBuffers();
CoInitialize(NULL);
init();
//start the video capture
camera.Init(0,xsize,ysize);
camera.SetFlippedImage(true);
argMainLoop(NULL,keyEvent,mainLoop);
CoUninitialize();
}
Arvind Lakshmikumar
Research Scholar
Robotics Institute
Carnegie Mellon University
Pittsburgh, PA 15213-3890
Phone: 412 421 0824 (H)
412 268 5905 (W)
email: kla@c .........
Linux is like a Teepee,
No Windows, No Gates,
Only Apache Inside!
|
|||
| From: | Arvind Lakshmikumar <kla@c .........> | Received: | Feb 17, 2003 |
| To | artoolkit@h .................. | ||
| Subject: | Displaying camera images twice | ||
Folks,
I have a small problem with the camera initialization..I guess I posed
this question in a different way and haven't been too clear..I've included
the code fragment below..
I have 2 functions, both which need to call the camera display routines.
After I load one, how do I change control from one function to another..
Thanks a lot,
regards,
Arvind
*******************************************************************
void CGUIDlg::OnButton1LoadImage()
{
// TODO: Add your control notification handler code here
CoInitialize(NULL);
//initialize applications
init();
//start the video capture
camera.Init(0,xsize,ysize);
camera.SetFlippedImage(true);
argMainLoop(NULL,keyEvent,show);
/* get ready to grab a new video frame */
argSwapBuffers();
CoUninitialize();
}
void CGUIDlg::OnButton2Track()
{
// TODO: Add your control notification handler code here
ARUint8 *dataPtr;
ARMarkerInfo *marker_info;
int marker_num;
int j, k;
/* get ready to grab a new video frame */
//argSwapBuffers();
CoInitialize(NULL);
init();
//start the video capture
camera.Init(0,xsize,ysize);
camera.SetFlippedImage(true);
argMainLoop(NULL,keyEvent,mainLoop);
CoUninitialize();
}
Arvind Lakshmikumar
Research Scholar
Robotics Institute
Carnegie Mellon University
Pittsburgh, PA 15213-3890
Phone: 412 421 0824 (H)
412 268 5905 (W)
email: kla@c .........
Linux is like a Teepee,
No Windows, No Gates,
Only Apache Inside!
|
|||
| From: | Hartmut Seichter <hartmut@t ................> | Received: | Feb 18, 2003 |
| To | artoolkit@h .................. | ||
| Subject: | Re: Displaying camera images twice | ||
Arvind Lakshmikumar wrote: <snip/> Sorry, but first of all state clear what u wanna do. The functions do not give any hint what's the idea behind. To make a fairly wild guess is that u wanna start two capturing processes on the same camera? If that is the case I think your aproach does not work at all, due to the fact that ARToolKit is messed up with static global variables. /Hartmut -- technotecture studio ___________ building your next reality |
|||
| From: | Hartmut Seichter <hartmut@t ................> | Received: | Feb 18, 2003 |
| To | artoolkit@h .................. | ||
| Subject: | Re: Displaying camera images twice | ||
Arvind Lakshmikumar wrote: <snip/> Sorry, but first of all state clear what u wanna do. The functions do not give any hint what's the idea behind. To make a fairly wild guess is that u wanna start two capturing processes on the same camera? If that is the case I think your aproach does not work at all, due to the fact that ARToolKit is messed up with static global variables. /Hartmut -- technotecture studio ___________ building your next reality |
|||
| From: | Hartmut Seichter <hartmut@t ................> | Received: | Feb 18, 2003 |
| To | artoolkit@h .................. | ||
| Subject: | Re: Displaying camera images twice | ||
Arvind Lakshmikumar wrote: please, always answer to the Mailinglist and not directly to me. Can somebody fix this and add a Reply-To for the mailinglist. Arvind, I really why u don't pass the picture from your display process to the marker detection? You have to split your approach in: - initializing - press button a -> capture image -> show marker - press button b -> capture image -> detect marker Initializing the camera twice does not work until u unitialize it before, which makes no real sense. /retrakker > Hi Harmut, > I realize that I can't capture twice from 2 different processes. I have > a GUI that has say 2 buttons..One Get Image and one Track marker. When I > press get Image, I just want to display the image seen by the camera. Then > when I press Track Marker, I want to call the function that does the > tracking..So I guess when I press the second button, I need to be able to > switch the camera function by disabling its association with the previous > call.. -- technotecture studio ___________ building your next reality |
|||
| From: | Hartmut Seichter <hartmut@t ................> | Received: | Feb 18, 2003 |
| To | artoolkit@h .................. | ||
| Subject: | Re: Displaying camera images twice | ||
Arvind Lakshmikumar wrote: please, always answer to the Mailinglist and not directly to me. Can somebody fix this and add a Reply-To for the mailinglist. Arvind, I really why u don't pass the picture from your display process to the marker detection? You have to split your approach in: - initializing - press button a -> capture image -> show marker - press button b -> capture image -> detect marker Initializing the camera twice does not work until u unitialize it before, which makes no real sense. /retrakker > Hi Harmut, > I realize that I can't capture twice from 2 different processes. I have > a GUI that has say 2 buttons..One Get Image and one Track marker. When I > press get Image, I just want to display the image seen by the camera. Then > when I press Track Marker, I want to call the function that does the > tracking..So I guess when I press the second button, I need to be able to > switch the camera function by disabling its association with the previous > call.. -- technotecture studio ___________ building your next reality |
|||