Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

How to use IPP to get two images merging result

Xiang_Ma
Beginner
921 Views

Hi, I am new to IPP society. I believe the problemcould be solved by using IPP image process functions.

My problem is following:
There are two Grayscaleimages(8 bits) which havesame width andheight . Let image1 be first image and image2 be the second image. Let Image2 rotate 45 degree, so in image2, there are some area is black.
Ineed to use IPPfunctions to process images so that thefinal image will be: in black area of image2, final image will show image1's correspondingarea(so image2 has total transparency in black area). In no black area of image2, final image will show image2's corresponding area. Final image's width and height is same as image1 and image2.

Thanks


0 Kudos
3 Replies
Vladimir_Dudnik
Employee
921 Views
Hello,

I would recommend you to take a look at alpha composition functions in ipp (they will require your image 1 and image 2 being 4 channels)

Regards,
Vladimir
0 Kudos
Xiang_Ma
Beginner
921 Views
Hi, Vladimir:
It seems I should use ippiAlphaComp_8u_AC1R
or ippiAlphaCompC_8u_C1R with "OUT" type compositingoperation.

However, from testing, it doens' look right. From description in imageing tersm ,
"OUT" type operation should be " A outside B. NOT_B acts as a matter for A.
A shows only where B is not visible".

But I get mixed resultwhere A andB bothare visible. Only correct result where
B is not visible.

Could you please give detail help on how shouldI do this?

Thank you very much for the help!
0 Kudos
Chao_Y_Intel
Moderator
921 Views


Hi,

alpha composition compute all of image1 and image 2 data. You may see mixed image result. Possibly you can check the mask copy function, use image B data as mask. It will only copy none zero (not black) data:

ippiCopy_8u(image2, int srcStep, image1, int dstStep, IppiSize roiSize, image2, int maskStep);

Thanks,
Chao

0 Kudos
Reply