alpha blend using opencv 2.4.3

asked 2013-06-12 03:46:20 -0500

Parinda gravatar image

updated 2013-06-12 03:51:05 -0500

berak gravatar image
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
 #include<opencv/cv.h>
#include <iostream>
#include <math.h>
#include <string.h>

using namespace cv;
using namespace std;



int main(int argc, char* argv[])
{
    IplImage* src1 = cvLoadImage( "C:\\Users\\admi\\Pictures\\bubles.jpg" );
    IplImage* src2 = cvLoadImage( "C:\\Users\\admi\\Pictures\\bu.jpg" );
    int x = 280;
    int y = 80;
    int width = 60;
    int height = 60;
    double alpha = 0.5;
    double beta = 0.5;
     cvSetImageROI(src1,cvRect(1,1,640,480));
cvSetImageROI(src1, cvRect(x,y,width,height));
cvAddWeighted(src1, alpha, src2, beta, 0.0, src1);
cvResetImageROI(src1);
cvNamedWindow("Alpha_blend", 1);
cvShowImage("Alpha_blend", src1);
cvShowImage("Alpha_blend2", src2);
}

this is my code n its not working till there is no error in the code..plz help

edit retag flag offensive close merge delete

Comments

1

noone can help you if all you can say is : "its not working"

berak gravatar imageberak ( 2013-06-12 03:56:38 -0500 )edit

but it doesnt show any error aftr build

Parinda gravatar imageParinda ( 2013-06-13 05:24:46 -0500 )edit