Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
6625 Discussions

How to calculate Euclidean distance between RGB Pixels?

samueleforconi
Beginner
355 Views

Hi, I'm coding an algorithm for background estimation using Intel IPP, and I need to calculate the euclidean difference between pixels (RGB) of two consecutive video frames.


In other words, if Px and Py are the two RGB pixels I need to determine the value:
d(x,y) = sqrt( (Rx-Ry) + (Gx-Gy) + (Bx-By) ).

I see in the manual that there are some functions that can calculate the euclidean distance between an image and a template, but I can't figure out how can I use one of them to fit my needs.

Do you think that using a loop to iterate on each pixel of the two images is much more
expensive in calculation time than using the IPP function?

Thank you.
Samuele.
0 Kudos
1 Reply
Vladimir_Dudnik
Employee
355 Views

Hi Samuele,

We do not have such single primitive function. But you may try to implement this algorithm with combination of call for several IPP functions.

Regards,
Vladimir

Reply