Community
cancel
Showing results for 
Search instead for 
Did you mean: 
80 Views

Which is the simplest way to compare 2 images without having a temp. image as a destination

Hi,

The ippiCompare method requires 2 source and a temp. destination image for comparison. In some cases, it is enough to know the comparison result (bool) instead of having the difference pixels as well... Is there any fast and efficient way to do this with IPP?

Thanks,
Tamas
0 Kudos
2 Replies
Ying_H_Intel
Employee
80 Views

Hi,

The ippiCompare method requires 2 source and a temp. destination image for comparison. In some cases, it is enough to know the comparison result (bool) instead of having the difference pixels as well... Is there any fast and efficient way to do this with IPP?

Thanks,
Tamas

Hi Tamas,

Do you mean you hope to use a logical operation on compare two images, then you may try use ippiXor, for example, ippiXor_8u_C1IR(), In-place operation, it will use only two image, and write the result (Bool) in result image. ( 0 if same, 1 if difference)

Thanks
Ying
matthieu_darbois
New Contributor III
80 Views

Hi Tamas,

I don't see a function in ipp that would do the trick. Here are 3 solutions :
- To reduce the temp buffer size you could do an AbsDiff/Compare line by line and check if the Max/Min is 0/IPP_MAX_8U. Anyway, this will require 2 pass (AbsDiff/Compare then Max/Min).
- You could also use memcmp on the whole images or line by line if you require ROI.
- You could write a simple function which does exactly what you want using intrinsics or inline asm

For speed consideration, this will depend mostly on your data. For the 1st method, if images are the same most of the time, just sum the max of each line then compare otherwise, compare after each line.

Matthieu



Reply