Webcam doesn't work with openCV 1.0 C (CodeBlocks) -
i got problem, want window webcam displays; have windows ... black tried got image dimensions, it's 0x0 webcam good, works displaying of windows!! this's ma code (windows 7 x64 bits)
#include <iostream> #include <cv.h> #include <highgui.h> using namespace std; int main() { iplimage* img; cvcapture* capture = cvcapturefromcam (cv_cap_any); if (!capture) return 10; cvnamedwindow("video", cv_window_autosize); char key = 'a'; if (!cvgrabframe(capture)) return 20; while (key != 'q'){ img = cvretrieveframe(capture); cvshowimage("video", img); key = cvwaitkey(60); if (!cvgrabframe(capture)) key = 'q'; } cvdestroyallwindows(); img = null; cvreleasecapture(&capture); return 0; }
Comments
Post a Comment