ARToolKit | Mailing List Archive |
![]() |
From: | Eike M.Lang <lang@i ......................> | Received: | Nov 17, 2004 |
To | artoolkit@h .................. | ||
Subject: | Multiple cameras with MacOSX | ||
Hi everyone, I was trying to get the jumping man demo made by the Mixed Reality Lab=20= in Singapore to compile and run on MacOS X, but was faced with a couple=20= of problems (I threw out the vrml stuff so that doesn't apply here).=20 The demo uses two cameras through the ARToolkit functions and keeps=20 independent sets of parameters, pointers etc. for them. I wanted to use my iSight for tracking and a Logitech Quickcam 4000 as=20= the video source for the pip-like video display on a marker. I was under the impression, that specifying "-grabber=3D2" for one of = the=20 cameras would allow me to use both of them, but apparently I'm missing=20= something... 1.) Using ARToolkit (2.68.2) as is, the program fails when setting up=20 the second camera giving me an error message listing the camera=20 parameters. A quick check in the source revealed that in line 1254 of=20 video.c (in VideoMacOSX) should really be if (sscanf(&line[9], "%d", &grabber) =3D=3D 0) { instead of if (sscanf(&line[8], "%d", &grabber) =3D=3D 0) { (Note array index). Having fixed that I get past the stage where it failed before but=20 ARToolkit apparently only finds one sequence grabber (I.e. opening=20 sequence grabber 1 of 1.) where I'd expect it to find two. Each camera=20= by itself works flawlessly with ARToolkit and as I said, with a=20 different application I could verify that both cameras remain usable=20 when connected at the same time. Any help would be greatly appreciated. Regards, Eike --=20 Dipl.-Inform. Eike M. Lang Universit=E4t Duisburg-Essen (Standort Duisburg) Institut f=FCr Informatik und Interaktive Systeme Lotharstrasse 65, Raum LF 284, 47057 Duisburg email: lang@i ...................... Tel. : +49 203 379-1417 Fax -3557 |
From: | Eike M.Lang <lang@i ......................> | Received: | Nov 18, 2004 |
To | Philip Lamb <phil@e ..........> | ||
Subject: | Re: Multiple cameras with MacOSX | ||
Am 17.11.2004 um 22:35 schrieb Philip Lamb: Hi Philip, forget my last my mail (which I accidentally sent only to you=20 personally). > As of ARToolKit 2.68.2 and later (see=20 > http://artoolkit.sourceforge.net/ for ART 2.69) there is a=20 > standardised way to open more than one video stream across platforms=20= > (including Mac OS X), which is to use the ar2Video*() set of=20 > functions. I.e. you would code something like: > AR2VideoParamT *camera1Vid =3D ar2VideoOpen(NULL); > AR2VideoParamT *camera2Vid =3D ar2VideoOpen(NULL); > and then you pass camera1Vid or camera2Vid (as appropriate for your=20 > application) as a parameter to the other calls such as=20 > ar2VidoCapStart(), ar2VideoGetImage() etc. I accidentally did that before, I only was too stupid to see the=20 "Source" tab in the camera settings dialog. Lesson: don't try to use=20 one camera for both purposes at the same time %-) Best Regards, Eike --=20 Dipl.-Inform. Eike M. Lang Universit=E4t Duisburg-Essen (Standort Duisburg) Institut f=FCr Informatik und Interaktive Systeme Lotharstrasse 65, Raum LF 284, 47057 Duisburg email: lang@i ...................... Tel. : +49 203 379-1417 Fax -3557 |
From: | Philip Lamb <phil@e ..........> | Received: | Nov 18, 2004 |
To | Eike M.Lang <lang@i ......................>, artoolkit@h .................. | ||
Subject: | Re: Multiple cameras with MacOSX | ||
At 11:02 AM +0100 17/11/04, Eike M.Lang wrote: >Hi everyone, > >I was trying to get the jumping man demo made by the Mixed Reality >Lab in Singapore to compile and run on MacOS X, but was faced with a >couple of problems (I threw out the vrml stuff so that doesn't apply >here). The demo uses two cameras through the ARToolkit functions and >keeps independent sets of parameters, pointers etc. for them. > >I wanted to use my iSight for tracking and a Logitech Quickcam 4000 >as the video source for the pip-like video display on a marker. > >I was under the impression, that specifying "-grabber=2" for one of >the cameras would allow me to use both of them, but apparently I'm >missing something... Hi Eike, As of ARToolKit 2.68.2 and later (see http://artoolkit.sourceforge.net/ for ART 2.69) there is a standardised way to open more than one video stream across platforms (including Mac OS X), which is to use the ar2Video*() set of functions. I.e. you would code something like: AR2VideoParamT *camera1Vid = ar2VideoOpen(NULL); AR2VideoParamT *camera2Vid = ar2VideoOpen(NULL); and then you pass camera1Vid or camera2Vid (as appropriate for your application) as a parameter to the other calls such as ar2VidoCapStart(), ar2VideoGetImage() etc. I apologise for the naming of the -grabber parameter. It is perhaps a little misleading, as it refers not to cameras but to the Mac OS X components which manage connections with cameras. Most people will only ever have one grabber, regardless of how many cameras they have plugged in. However, some specialised video capture systems include their own grabber components, hence the requirement for this option. >quick check in the source revealed that in line 1254 of video.c (in >VideoMacOSX) should really be > > if (sscanf(&line[9], "%d", &grabber) == 0) { > >instead of > if (sscanf(&line[8], "%d", &grabber) == 0) { > >(Note array index). You are correct in your identification of this bug, and I've fixed it in CVS. However, it wasn't contributing to your problem. Regards, Phil. -- Philip Lamb Research Student, Human Interface Technology Laboratory New Zealand, University of Canterbury, Christchurch, NZ. +64 3 3642987 x3070 |