XIMEA Image format incorrect after DOWNSAMPLING (Bug #3836)


Added by Jean-Yves Deschenes over 10 years ago. Updated over 9 years ago.


Status:Open Start date:2014-07-31
Priority:Normal Due date:
Assignee:Jean-Yves Deschenes % Done:

0%

Category:highgui-camera
Target version:-
Affected version:2.4.9 (latest release) Operating System:Windows
Difficulty:Easy HW Platform:x64
Pull request:

Description

If I open a XIMA camera and set the downsampling, the retrieved capture frames will have the wrong dimensions.

        // Open the camera:
    cv::VideoCapture cam;
        cv::Mat bufferFrame;
        int columns = 0;

    cam.open(inputName);
        cam.read(bufferFrame); 
        columns = bufferFrame.columns;  //  _Columns value is 2592_

        cam.set(CV_CAP_PROP_XI_DATA_FORMAT, XI_RGB24 );
        cam.set(CV_CAP_PROP_XI_DOWNSAMPLING, ximeaDefaultBinningMode);

        // In the thread loop
    cam.read(bufferFrame);
        columns = bufferFrame.columns;  //  _Columns value is still 2592_

Now, that seems to come from the fact that, in cap_ximea.cpp,

        void CvCaptureCAM_XIMEA::resetCvImage()  // Called from CvCaptureCAM_XIMEA::retrieveFrame()
        {
         ...
        if( (int)image.width != width || (int)image.height != height || image.frm != (XI_IMG_FORMAT)format)
        ...
        }

the validation checks for the identity of the image dimensions (which are the same, since they were updated by the internal CvCaptureCAM_XIMEA::grabFrame() call), but does not check for the identity of the frame dimensions (which have not been changed, and need to).
An easy fix probably would be to add a check of the frame.cols and frame.rows in that condition line.

Associated revisions

Revision 8616cd87
Added by Vadim Pisarevsky almost 10 years ago

Merge pull request #3836 from Dmitry-Me:uninitializedMember

History

Updated by Dmitry Retinskiy over 10 years ago

Jean-Yves, thanks for the report.
Could you put your suggested correction in the form of pull request?
(see http://www.code.opencv.org/projects/opencv/wiki/How_to_contribute for details).
Thanks.

  • Status changed from New to Open
  • Description changed from If I open a XIMA camera and set the downsampling, the retrieved capture frame... to If I open a XIMA camera and set the downsampling, the retrieved capture frame... More
  • Target version deleted (2.4.10)
  • Assignee set to Jean-Yves Deschenes

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4798

Also available in: Atom PDF