How to get raw data by OpenCV?

asked 2020-11-04 03:22:22 -0600

wilber1222 gravatar image

updated 2020-11-04 03:38:18 -0600

Hi all,

I want to get raw12 data form my camera.

My OpenCV APIs version is 2.4.13.6, and the IDE is Visual studio 2010.

I had found similar issue int the forum.

I had used "camera1.set(CV_CAP_PROP_CONVERT_RGB,0) " to disable convert to RGB,

but it always return false. Is there another way to get raw image?

Otherwise, I couldn't find the videoio.hpp in this SDK,

is it not support output another format in this version?

int main(int argc, char **argv) {

VideoCapture camera1;
Mat frame1;
camera1 = VideoCapture(CV_CAP_DSHOW);
camera1.open(0);

camera1.set(CV_CAP_PROP_FRAME_WIDTH,1920);
camera1.set(CV_CAP_PROP_FRAME_HEIGHT,1081);

bool ok = camera1.set(CV_CAP_PROP_CONVERT_RGB,0);

//VideoWriter video1;

cout << camera1.get(CV_CAP_PROP_FRAME_WIDTH) << endl;
cout << camera1.get(CV_CAP_PROP_FRAME_HEIGHT) << endl;
Size s1 = Size((int)camera1.get(CV_CAP_PROP_FRAME_WIDTH),(int)camera1.get(CV_CAP_PROP_FRAME_HEIGHT));


while(!camera1.isOpened()){
    cout << "Camera not opened" << endl;
    continue;
}
while(1){
    camera1.read(frame1);
    imshow("Display1",frame1);
    cout << frame1.data << endl;
    if(waitKey(1) == 27){
        break;
    }
}
camera1.release();
return 0;
}
edit retag flag offensive close merge delete

Comments

My OpenCV APIs version is 2.4.13.6,

DEAD. NO MORE MAINTAINED. DONT TRY WITH THAT

I couldn't find the videoio.hpp in this SDK

indeed, API was organized differently, it's all in highgui

berak gravatar imageberak ( 2020-11-04 03:46:41 -0600 )edit

Hi Sir, is there new version can support VS2010?

wilber1222 gravatar imagewilber1222 ( 2020-11-04 07:27:13 -0600 )edit

probably not. you're living in the past ;(

berak gravatar imageberak ( 2020-11-04 07:37:12 -0600 )edit