Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

addweighted for mix of two image

i want to mix a part of any image with original image and i write this program but my program produce strange answer why?please help me , my original image is "khaste.jpg"

    Mat image;
Mat im;
image=imread("khaste.jpg",CV_LOAD_IMAGE_COLOR);
im=imread("kari o behrooz.jpg",CV_LOAD_IMAGE_COLOR);
Rect roi=Rect(150,200,40,60);
Mat image_roi=image(roi);
Mat im_roi=im(roi);

addWeighted(image_roi,.3,im_roi,.7,0,image);

namedWindow("k",1 );
imshow("k",image);
cvWaitKey(0);
return (0);

}

addweighted for mix of two image

i want to mix a part of any image with original image and i write this program but my program produce strange answer only result of mixing of two parts but i want to see may original image with a part that is mixed with a part of another image why?please help me , my original image is "khaste.jpg"

    Mat image;
Mat im;
image=imread("khaste.jpg",CV_LOAD_IMAGE_COLOR);
im=imread("kari o behrooz.jpg",CV_LOAD_IMAGE_COLOR);
Rect roi=Rect(150,200,40,60);
Mat image_roi=image(roi);
Mat im_roi=im(roi);

addWeighted(image_roi,.3,im_roi,.7,0,image);

namedWindow("k",1 );
imshow("k",image);
cvWaitKey(0);
return (0);

}