Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

read video & recostruction

Hi at all!!! I'm reading video from my memory and I execute some operation on it. When I read video I take a single frame (320x240) , I separe it with 10x10 grid and I save the single "box" (10x10) in a vector (Mat recostruction[768]). I create an other vector wich contains bool value. Each cell of vector contains bool value. Based on the value of the cells I recostruct the single box with different background color (true= red background image, false=normal backgrund image). When I show my output the output window is black and I don't show my rebuilt video. How I fix this problem? thank you for your time!

CvCapture* capture = cvCreateFileCapture("Scene1.avi"); IplImage* frame; while(true) { frame = cvQueryFrame(capture); if(!frame) break; Mat current(frame); Mat ricostruzione[768]; Mat output = cv::Mat::zeros(240, 320, CV_8UC3); int aa[768]; int bb[768]; for(int a=0; a<320; a+=10) { for(int b=0; b<240; b+=10) { Mat SUPPORT_2 (current, Rect(a,b,10,10)); ricostruzione[conteggio_c] = SUPPORT_2.clone(); aa[conteggio_c] = a; bb[conteggio_c] = b; /--------------------------------------------- some operations ----------------------------------------------/ conteggio_c++; } } conteggio_c = 0; bool recost[768]; for ( int t=0; t<768; t++) { /-------------------------------------- some operations and filling bool vector ---------------------------------------/ } imshow("original", current); waitKey(1); imshow("OUTPUT", output); waitKey(1); }

read video & recostruction

Hi at all!!! I'm reading video from my memory and I execute some operation on it. When I read video I take a single frame (320x240) , I separe it with 10x10 grid and I save the single "box" (10x10) in a vector (Mat recostruction[768]). I create an other vector wich contains bool value. Each cell of vector contains bool value. Based on the value of the cells I recostruct the single box with different background color (true= red background image, false=normal backgrund image). When I show my output the output window is black and I don't show my rebuilt video. How I fix this problem? thank you for your time!

CvCapture* capture = cvCreateFileCapture("Scene1.avi");
IplImage* frame;
while(true)
{
    frame = cvQueryFrame(capture);
    if(!frame) break;
    Mat current(frame);
    Mat ricostruzione[768];
    Mat output = cv::Mat::zeros(240, 320, CV_8UC3);
    int aa[768];
    int bb[768];
    for(int a=0; a<320; a+=10)
    {
        for(int b=0; b<240; b+=10)
        {
            Mat SUPPORT_2 (current, Rect(a,b,10,10));
            ricostruzione[conteggio_c] = SUPPORT_2.clone();
            aa[conteggio_c] = a;
            bb[conteggio_c] = b;
            /---------------------------------------------
/*---------------------------------------------
            some operations
            ----------------------------------------------/
----------------------------------------------*/
            conteggio_c++;
        }
    }
    conteggio_c = 0;
    bool recost[768];
    for ( int t=0; t<768; t++)
    {
        /--------------------------------------
/*--------------------------------------
        some operations and filling bool vector
        ---------------------------------------/
---------------------------------------*/
    }
    imshow("original", current);
    waitKey(1);
    imshow("OUTPUT", output);
    waitKey(1);
}

}