OpenCV libv4l2 error mit pixelformat



  • Hallo c-community,

    ich versuche gerade eine uvc-Kamera mit OpenCV zu benutzen. Dabei habe ich aber das Problem, dass OpenCV folgende Fehlermeldung ausgibt:

    libv4l2: error setting pixformat: Argument ist ungültig
    HIGHGUI ERROR: libv4l unable to ioctl S_FMT

    Ich habe mir das mal angeschaut in der cap_libv4l.cpp:

    CLEAR (capture->form);
    717 capture->form.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    718 capture->form.fmt.pix.pixelformat = V4L2_PIX_FMT_BGR24;
    719 capture->form.fmt.pix.field = V4L2_FIELD_ANY;
    720 capture->form.fmt.pix.width = capture->width;
    721 capture->form.fmt.pix.height = capture->height;
    722
    723 if (-1 == xioctl (capture->deviceHandle, VIDIOC_S_FMT, &capture->form)) {
    724 fprintf(stderr, "HIGHGUI ERROR: libv4l unable to ioctl S_FMT\n");
    725 return -1;
    726 }
    727
    728 if (V4L2_PIX_FMT_BGR24 != capture->form.fmt.pix.pixelformat) {
    729 fprintf( stderr, "HIGHGUI ERROR: libv4l unable convert to requested pixfmt\n");
    730 return -1;
    731 }

    Ok anscheinend möchte er ein RGB/BGR-Bild aktivieren, welches im 24bit-Format ist. Meine Kamera hat aber RAW-Format mit 8bit-Tiefe. Kann ich hier OpenCV mit anderen Einstellungen für V4L dazu bringen die Kamera zu verwenden?

    MfG
    mirrowwinger


Anmelden zum Antworten