CvCaptureCAM_XIMEA update (Patch #2586)


Added by Marian Zajko over 12 years ago. Updated over 11 years ago.


Status:Done Start date:2012-11-29
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:highgui-camera
Target version:2.4.6
Affected version:branch '2.4' Operating System:
Difficulty: HW Platform:
Pull request:https://github.com/Itseez/opencv/pull/981

Description

Hi, please find attached the patch created against commit 50bebd6f0b9c5ceeb1a1d530b6442d476c820ea8 in the
master (git://github.com/Itseez/opencv.git).

Update contains:
  • OpenCVFindXimea.cmake : fixed XIMEA API path checking, added option for WINX64 systems
  • cap_ximea.cpp : fixed retrieveFrame() method to support monochrome cameras
  • CMakeLists.txt (from highgui module) : added xiAPI library option for WINX64 systems

0001-OpenCVFindXimea.cmake-update.patch (47.5 kB) Marian Zajko, 2012-11-29 05:09 pm

ximea.jpg (403 kB) Andrew Senin, 2013-06-10 06:21 pm


Related issues

blocks Bug #3851: Error in cap_ximea.cpp Open 2014-08-08

Associated revisions

Revision e6d6a3a8
Added by Andrey Pavlenko almost 11 years ago

Merge pull request #2586 from ilya-lavrenov:ipp_disable

History

Updated by Kirill Kornyakov over 12 years ago

Marian, thank you for the patch!

Please note that if you patch is based on the master branch, this will go to the 2.5 release (~2013, June). But if you think that this update would be useful in 2.4.4 release, I would suggest you to make a pull request to the 2.4 branch.

  • Target version changed from 2.4.4 to 3.0

Updated by Marian Zajko about 12 years ago

Hi Kirill, how many versions are planned to be released before the 2.5 in june?

Updated by Kirill Kornyakov about 12 years ago

A lot of minor revisions, and 2.5 may be delayed... Actually GitHub pull requests is the only way to speedup integration process, otherwise this patch may stay here forever (as you see). OpenCV team simply doesn't have enough resources to process all tickets, that's why contributions that could be tested automatically have higher priority.

  • Affected version set to 2.4.3

Updated by Burak Orcun OZKABLAN almost 12 years ago

Is it fixed?

Updated by Andrew Senin over 11 years ago

Hello Marian,

I'm working on integrating the patch to the current OpenCV code so that it can be part of the next version (hopefully OpenCV 2.4.6). But after testing I have found a problem with b/w cameras. I saw images similar to the attached file.

After investigating I found a possible bug in the CvCaptureCAM_XIMEA::open function. There you set format without considering isColor variable. So currently you have:

    // default image format RGB24
    format = XI_RGB24;
    mvret = xiSetParamInt( hmv, XI_PRM_IMAGE_DATA_FORMAT, format);
    if(mvret != XI_OK) goto error;

    // allocate frame buffer for RGB24 image
    frame = cvCreateImage(cvSize( width, height), IPL_DEPTH_8U, 3);

    // check if is color camera
    xiGetParamInt(hmv, XI_PRM_IMAGE_IS_COLOR, &isColor);

I've replaced it with the following code:

    // default image format RGB24
    format = XI_RGB24;

    // check if is color camera
    xiGetParamInt(hmv, XI_PRM_IMAGE_IS_COLOR, &isColor);
    if (!isColor)
    {
        format = XI_RAW8;
    }

    mvret = xiSetParamInt( hmv, XI_PRM_IMAGE_DATA_FORMAT, format);
    if(mvret != XI_OK) goto error;

    // allocate frame buffer for RGB24 or RGB8 image
    frame = cvCreateImage(cvSize( width, height), IPL_DEPTH_8U, (isColor)?(3):(1));

And now it works correctly for me.

So, could you please confirm my fix is correct or possibly provide an updatted patch?

Thanks,
Andrew Senin

Updated by Marian Zajko over 11 years ago

Dear Mr. Senin, please download and install the latest beta version of the XIMEA API Software package, during installation make sure that during the Choose Components step the OpenCV demo option from the Vision Libraries section is checked. After successfull installation please inspect the build_files folder in the OpenCV demo folder ({Package Root}\VisionLibraries\OpenCV). It contains the most recent versions of the cmake script and ximea cvCap module. Please use the files from the SW package for the patch. Thank you.

Updated by Andrew Senin over 11 years ago

Marian,

Thanks for pointing me to the new version of the integration code. It works for me. But I believe the changes in CMakeLists.txt (from highgui module) is also important (there is such change in the original patch but not in the beta pack). Otherwise it does not work on x64. Could you please confirm that I shall also add the fix from the original patch for CMakeLists.txt too?

The fix for CMakeLists.txt replaces the following line:

  list(APPEND HIGHGUI_LIBRARIES m3api)

with the following:

    
  if(CMAKE_CL_64)    
    list(APPEND HIGHGUI_LIBRARIES m3apiX64)    
  else()    
    list(APPEND HIGHGUI_LIBRARIES m3api)    
  endif()

Thanks

Updated by Andrew Senin over 11 years ago

The code is integrated. I believe this issue shall be closed.

Updated by Vladislav Vinogradov over 11 years ago

  • Status changed from Open to Done
  • Pull request set to https://github.com/Itseez/opencv/pull/981
  • Affected version changed from 2.4.3 to branch '2.4'
  • Target version changed from 3.0 to 2.4.6

Also available in: Atom PDF