Overlaying two images Magick++
Posted: 2011-05-11T10:05:39-07:00
Hi! I have 2 images:
first:
http://img696.imageshack.us/img696/1261/rd1mz.jpg
second:
http://img705.imageshack.us/img705/8807/traei.png
How i can overlay these images and get this image:
In OpenCV I do that so:
How do that with magick++ ?
p.s. black pixels in the second image are RGB (0,0,0)
first:
http://img696.imageshack.us/img696/1261/rd1mz.jpg
second:
http://img705.imageshack.us/img705/8807/traei.png
How i can overlay these images and get this image:
In OpenCV I do that so:
Code: Select all
...
// create mask
IplImage *msk = cvCreateImage(cvSize(firstImage->width, firstImage->height), 8, 1);
// convert mask to Grayscale
cvCvtColor(firstImage, msk, CV_BGR2GRAY);
...
cvCopy(secondImage, resultImage); // copy second image to result image
...
cvCopy(firstImage, resultImage, msk); // copy first image to result image with mask
p.s. black pixels in the second image are RGB (0,0,0)