2个图片的叠加

        //test add two tegether
        if(frameNum%9==0)
        {
             if(add==NULL)
            {
                add1 = cvCreateImage(cvSize(pImg->width,pImg->height), pImg->depth, pImg->nChannels);
                add = cvCreateImage(cvSize(pImg->width,pImg->height) , pImg->depth, pImg->nChannels);
            }
            else
            {
                cvAddWeighted( add1, 1, pImg, 1, 0  , add );
                add1 = cvCloneImage(pImg);
            }
        }
        cvShowImage("add",add);

你可能感兴趣的:(2个图片的叠加)