#include <cv.h>#includeintMainintargcChar**argv) {Iplimage*src1,*Src2; if((Src1 = Cvloadimage ("001.jpg",1)) !=0) && (Src2 = Cvloadimage ("002.jpg",1)) !=0)) { intx =850; inty = -; intwidth = $; intHeight = $; intAdd = -; DoubleAlpha =0.8; DoubleBete =0.2; //ROI increases pixels for a given picture from the upper-left corner (x, y) with a length-width of width,heightCvsetimageroi (Src1, Cvrect (x, y, width, height)); Cvsetimageroi (Src2, Cvrect (910, -, width, height)); Cvaddweighted (Src1, Alpha, SRC2, Bete,0.0, SRC1); //add pixels and store in src//releasing ROI based on a given rectangleCvresetimageroi (SRC1); //Create WindowCvnamedwindow ("main1",1); //Cvnamedwindow ("Main2", 1); //show src by a new windowCvshowimage ("main1", SRC1); //cvshowimage ("mian2", SRC2);Cvwaitkey (); Cvreleaseimage (&Src1); Cvreleaseimage (&src2); Cvdestroywindow ("main1"); //Cvdestroywindow ("main2"); } return 0;}
Alpha Fusion ROI in SRC2