Ask Your Question

AntarticMonkey's profile - activity

2014-05-29 09:24:28 -0600 answered a question Images captured from webcam are cropped

I was releasing the frame before finishing to process the image, as i'm using a thread to process the image i was doing this:

this->visor->setImage(frame); //image processing
frame.release();

But now, just to solve quickly, I decided to sleep before releasing:

this->visor->setImage(frame);
QThread::msleep(50);//give sometime to process the image
frame.release();

Sure a mutex or some other multithreading mechanism for synchronization would be better than just waiting but this is not a serious work. Regards, AM.

2014-05-27 09:23:30 -0600 asked a question Images captured from webcam are cropped

Hi there, iḿ using OpenCv 2.4.8 trying to capture video from my webcam. The problem it's that sometimes I get a cropped like this: imageCropped Image.

This the code i 'm using:

void CaptureThread::run(){
this->activo=true;
cap = new VideoCapture(0);
cap->set(CV_CAP_PROP_FRAME_WIDTH, 640);
cap->set(CV_CAP_PROP_FRAME_HEIGHT, 480);

while(this->activo){
    QThread::msleep(10);
    Mat frame;
    cap->operator >>(frame);
    if( frame.empty() ){
        continue;
    }
    this->visor->setImage(frame);
    frame.release();
}

}

And every time I run the app i get this message:

HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP

HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP

Thanks, for you help. AM