#include <cv.h>
#include <highgui.h>
int main(int argc, char** argv)
{
IplImage *src1,*src2;
if (((src1 = cvLoadImage("001.jpg", )) != ) && ((src2 = cvLoadImage("002.jpg", )) != ))
{
int x = ;
int y = ;
int width = ;
int height = ;
int add = ;
double alpha = 0.8;
double bete = 0.2; //给定图片的从左上角(x,y) 长宽为width,height的区域进行ROI增加像素
cvSetImageROI(src1, cvRect(x, y, width, height));
cvSetImageROI(src2, cvRect(, , width, height));
cvAddWeighted(src1, alpha, src2, bete, 0.0, src1);
//增加像素 并且存储在src
//释放基于给定矩形的ROI
cvResetImageROI(src1);
//创建窗口
cvNamedWindow("main1", );
//cvNamedWindow("main2", 1);
//通过新建的窗口对src进行show
cvShowImage("main1", src1); //cvShowImage("mian2", src2);
cvWaitKey();
cvReleaseImage(&src1);
cvReleaseImage(&src2);
cvDestroyWindow("main1");
//cvDestroyWindow("main2");
}
return ;
}