Ask Your Question

gonzafirewall's profile - activity

2015-09-02 15:11:01 -0600 commented question cvCvtColor nv12 from V4l buffer

I resolved using opencv in c++ and before to saving use a sws_scale conversion from NV12 to BGR24 before i show you the code resulting

2015-09-02 12:19:01 -0600 commented question cvCvtColor nv12 from V4l buffer
2015-09-02 12:12:11 -0600 commented question cvCvtColor nv12 from V4l buffer

i use the cv::cvtColor from cpp lib and now i have an image broken equally this is the code now http://pastebin.com/gsGDFSmu and this is the result image https://drive.google.com/file/d/0Bz9I...

2015-09-01 23:56:16 -0600 asked a question cvCvtColor nv12 from V4l buffer

Hi people i have a problem when i try con conver nv12 buffer to BGR and write to jpeg.

This is the code

void* detect(void  * ptr_data)
{
        LOGI("enter to detect");
        CvMat cvmat;
        CvMat cvMatConverted;
        cvmat = cvMat(720, 1280,  CV_8UC3, ptr_data);
        LOGI("cvmat: cols %d, rows %d, ptr %u\n", cvmat.cols, cvmat.rows,cvmat.data);
        LOGI("before converted");
        cvMatConverted = cvMat(720,1280, CV_8UC3, &ptr_data);
        LOGI("before cvtcolor");
        cvCvtColor(&cvmat,&cvMatConverted,CV_YUV2BGR_NV12);
        LOGI("after cvtcolor");
        cvSaveImage("/sdcard/emma-frame.jpg",&cvMatConverted,0);
        return NULL ;
}

the error says that can not convert because:

E/cv::error()( 1749): OpenCV Error: Assertion failed (dst.data == dst0.data) in void cvCvtColor(const CvArr, CvArr, int), file /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/imgproc/src/color.cpp, line 4424