This project is read-only.

Problems calibrating camera

Feb 8, 2011 at 9:26 PM

I'm working on an augmented reality project for school and am at the point where I need to generate the calib.xml file. (I'm using ALVAR 1.4 and Goblin XNA v3.5)

I've tried running both SampleCamCalib.cpp (from ALVAR) and CameraCalibration (from GoblinXNA) but haven't had any luck. SampleCamCalib will run but can't seem to detect my webcam because the last line printed to the screen is "Could not find any capture devices". CameraCalibration seems to recognize my webcam because the light on the camera turns on whenever I run the project. But the code doesn't seem to be executing because I just get a blank window with the cornflower blue background.

I've tried using a PS3Eye, a Nexxtech and a rocketFish webcam. Currently I am using a Logitech C210 webcam because I read somewhere that people generally have better success with AR when using Logitech cameras. I can run the driver for the camera and it picks up a video feed perfectly so it's not a matter of the computer detecting the camera.

I've been trying to sort this our for two weeks now so if anyone can shed some light on these problems it would be greatly appreciated!


Feb 8, 2011 at 10:39 PM

That's very interesting. I've only seen this problem once a while ago, and it was on a student's Mac book that runs Windows XP as parallel (or maybe it was bootcamp, don't remember). I myself use bootcamp on Macbook to run GoblinXNA (with Windows 7), and have seen people running parallel fine.

If you run the program, does it throw any exceptions? If not, it'll be quite hard to figure out the problem since I can't replicate the problem on any of the machines I can access.


Feb 8, 2011 at 11:11 PM
Edited Feb 9, 2011 at 12:25 AM

I am actually using Windows XP through VMware Fusion on my Macbook Pro (forgot to mention that). When I debug CameraCalibration this exception is thrown to the output window:


A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.Xna.Framework.dll

The thread '<No Name>' (0xda0) has exited with code 0 (0x0).

The program '[3608] CameraCalibration.exe: Managed' has exited with code 0 (0x0).


When I debug SampleCamCalib this appears in the output window:


First-chance exception at 0x7c81eb33 in samplecamcalibd.exe: Microsoft C++ exception: alvar::AlvarException at memory location 0x00daf748..

The program '[2952] samplecamcalibd.exe: Native' has exited with code 0 (0x0).



Feb 8, 2011 at 11:24 PM

Maybe that is exactly the setup the student had using VMware. The exception doesn't make any sense to me so there is no way for me to fix it.

I suggest that you run your Windows using bootcamp to run Goblin XNA. We know that it works well in this setup.


Feb 9, 2011 at 12:25 AM

Thanks for your fast replies! I will install bootcamp and let you know how it goes.

Feb 18, 2011 at 1:22 PM

So I installed bootcamp and I got SampleCamCalib.cpp to run properly! Thanks so much for your help!