Opencv Error on Ubuntu Webcam (Logitech C270) Capture -> HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP

后端 未结 5 1376
星月不相逢
星月不相逢 2021-02-08 03:32

this erorr message appears on running simple camera capture on Ubuntu with logitech C270 (OpenCV 2.4.2/C++):

HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-08 04:31

    If you don't feel like debugging the problem, and the frames from your webcam are being displayed without any issues, your option is to just shoot the messenger. The instructions below work if you have built OpenCV from source, as opposed to installing pre-built binaries.

    Start with grep -R "Corrupt JPEG data" ~/src/opencv-2.4.4/ and go deeper into the rabbit hole until you find what you want. In my case the culprit is at opencv-2.4.4/thirdparty/libjpeg/jdmarker.c:908:

      if (cinfo->marker->discarded_bytes != 0) {
        WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);
        cinfo->marker->discarded_bytes = 0;
      }
    

    The WARNMS2 macro is what's causing the error messages about extraneous data to be printed. Just comment it out, rebuild OpenCV and carry on with your work. I also have a C270, run Ubuntu 12.04, and experienced the same nagging error message until I did what I described above.

提交回复
热议问题