c++opencvcameramingwximea

XIMEA: openCV 2.4.9 can not find Ximea camera although it works fine with other programs


Although XIMEA camera(MQ013CG-E2) is ok and it is working with sample simple demo programs(for Win x64) from ximea.com, the next code always print "ximea camera not found":

VideoCapture cap;
if (!cap.open(CV_CAP_XIAPI)) cout << "ximea camera not found";

the same for :

CvCapture* capture = cvCreateCameraCapture(CV_CAP_XIAPI);
if (!capture) cout << "ximea camera not found";

If simple Logitech web-camera is connected then code above shows it exists (with CV_CAP_ANY flag). But ximea-camera is unreachable from openCV. OpenCV is build using cmake with option "WITH_XIMEA" by minGW from official source.

Have someone ever read something from ximea camera via openCV? I know this kind of cameras is not very popular, I could not even find tag "ximea" here (creating new tag requires 1500 reputation so no "ximea" tag here too).

UPD: I can transfer info from camera to openCV via xiApi.h-functions. So camera definitely works.

UPD2: I have been provided today with new MSVS-project example from ximea, which includes new openCV 2.4.9 libs. It contains code:

capture = cvCaptureFromCAM(0); //0=default, -1=any camera, 1..99=your camera
if (!capture) cout << "no camera detected" << endl;

I compiled it in MSVS it and exe-file started to work with ximea cam as expected using opencv-libs provided by ximea. But when I am trying to compile the same code in Eclipse and use opencv-libs created by MinGW with "WITH_XIMEA" option, it always shows "no camera detected". I checked all settings in CMake, Eclipse project "compiler includes" and "MinGW linker libs" twice but still can not understand where is my mistake.


Solution

  • I spent some time checking here and there all settings and decided to compile openCV by MSVS, not by minGW. Then I got error with "xiExt.h" (I missed it while minGW compilation process), I googled it and found this bug report. Then I commented one line in source code, compiled it by minGW and.. it started to work!

    It is only openCV 2.4.9 proplem since 2.4.10 does not contain this buggy #include "xiExt.h" anymore.