OpenCV 1.0 not grabbing from webcam [closed]

asked 2015-01-19 09:25:44 -0600

spartanhooah gravatar image

I'm trying to get this project working using OpenCV 1.0, the most recent Qt 4.x release, and Visual Studio 2010. However, when it's supposed to grab an image from the webcam (using a wrapped call to cvQueryFrame), the pointer that's returned is null. I tried setting up some simple code myself to figure out where the problem is, but it still persists. Here is my code:

opencvWebcam webcam;
IplImage* testImage = nullptr;
CvCapture *test = cvCaptureFromCAM(0);

int dummy = cvGrabFrame(test);
testImage = cvRetrieveFrame(test);  // testImage is null here

cvNamedWindow("image");
cvShowImage("image", testImage);
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-11-17 04:52:57.396719

Comments

1

Let's put this to an immediat end right from the beginning ... OpenCV1.0 is old, depricated, discarded and not supported anymore. It still uses the old C-API which is just completely gone when the final 3.0 release will be put online. So please use at least the 2.4.10 stable release with the C++ interface ...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-01-19 09:36:28 -0600 )edit

Also, getting AAM to work in a OpenCV1.0 setup is pushing your luck :D

StevenPuttemans gravatar imageStevenPuttemans ( 2015-01-19 09:37:18 -0600 )edit
1

warranty for 1.0 is void ...

berak gravatar imageberak ( 2015-01-19 09:38:25 -0600 )edit

I'm well aware that it's a (really) old version, but this project seems like the best starting point for what I want to do (you can see that in my other question). Would it be worth it to either start walking forward in versions from 1.0 until something breaks compile-wise or start at the newest version and walk backward until it does compile?

Also, @StevenPuttemans, do you have a better suggestion for an AAM implementation in a more recent version? I haven't had any luck finding one.

spartanhooah gravatar imagespartanhooah ( 2015-01-20 11:14:53 -0600 )edit
2

^^ i'd say, don't waste your energy on something such outdated.

rather, get a modern opencv version, also, if all you wanted is some AAM, or facial landmarks, instead look here or , even better use dlib s !

berak gravatar imageberak ( 2015-01-20 11:26:03 -0600 )edit

@berak Thanks for the suggestion from GitHub, although I'm having some problems with that as well (contacted the author). Could you provide anything more specific than "use dlib"?

spartanhooah gravatar imagespartanhooah ( 2015-01-20 16:58:33 -0600 )edit
1

http://dlib.net/face_landmark_detecti... . needs 95mb pretrained model, but works like a charm !

berak gravatar imageberak ( 2015-01-20 17:35:39 -0600 )edit