Ask Your Question

Which version of OpenCV allows using universal intrinsics?

asked 2020-03-04 13:02:46 -0500

Zana Zakaryaie Nejad gravatar image

updated 2020-03-04 13:11:34 -0500

supra56 gravatar image


I want to use universal intrinsics to accelerate some functions inside my code. My current OpenCV version is 3.4.5 and it doesn't let me do it (link text)

I have two questions:

  1. Which version of OpenCV allows me to use them?
  2. Is there any documentation about the supported intrinsics?
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-03-05 03:26:00 -0500

Eduardo gravatar image

The relevant commit is here. List of OpenCV versions are:

 4.2.0 4.2.0-openvino 4.1.2 4.1.2-openvino 4.1.1 3.4.9 3.4.8 3.4.7

For 3.4 branch, the doc is here. You can switch the OpenCV version at the top of the page using the combo box.

I found the Intel Intrinsics Guide and the ARM NEON guide and this page useful.

edit flag offensive delete link more



Thanks. I have just built OpenCV 4.2.0 and it was slower than 3.4.5! So, I'm uninstalling it and go back to 3.4.5 version. Could you please explain the possible reasons? The Cmake flags I used, were the same for 3.4.5 and 4.2.0.

Zana Zakaryaie Nejad gravatar imageZana Zakaryaie Nejad ( 2020-03-05 03:32:06 -0500 )edit

I would run the perf tests and compare the results between the two versions.

What functions are you using? Best is to use a profiler to pinpoint the bottleneck.

Normally, there is no obvious reason about why 4.20 is slower than 3.4.5 in your case.

Edit your question to post the OpenCV information, and some information about your CPU, environment: std::cout << cv::getBuildInformation() << std::endl;

Eduardo gravatar imageEduardo ( 2020-03-05 07:35:38 -0500 )edit

@Zana Zakaryaie Nejad. OpenCV version x.x.x are not slower. You have to edited your code to improvement. Get back OpenCV 4.2.0.

supra56 gravatar imagesupra56 ( 2020-03-05 08:23:48 -0500 )edit

@supra56, @Eduardo Thanks for the replies. It was also strange for me to see that difference in runtimes. I checked more and found that it was just an issue with the power of my Laptop!! When I plugged the charger, the speed of 4.2.0 was same as 3.4.5.

Anyway, according to your suggestions, I can use OpenCV 4.2.0. Are there any flags I should set to be able to use both SSE2 and Neon? (e.g. CPU_BASELINE=SSE2 CPU_DISPATCH=SSE4_2,AVX)

Zana Zakaryaie Nejad gravatar imageZana Zakaryaie Nejad ( 2020-03-05 09:25:43 -0500 )edit

No need to tweak the flags, just let the automatic detection. It is one library per architecture, that is one library for x86, one library for ARM, one library for PowerPC, ...

Eduardo gravatar imageEduardo ( 2020-03-05 09:53:10 -0500 )edit

No. You don't need flags.

supra56 gravatar imagesupra56 ( 2020-03-05 20:35:36 -0500 )edit

Question Tools

1 follower


Asked: 2020-03-04 13:02:46 -0500

Seen: 273 times

Last updated: Mar 05 '20