2

I download the opencv3.4.5 from github https://github.com/opencv/opencv/archive/3.4.5.zip. And the libjpeg-turbo is located at 3rdparty dir. And build it with -D WITH_JPEG=ON and -D BUILD_JPEG=ON added. I can check this in CMakeCache.txt. But i cannot find any thing related with libjpeg-turbo at install/include or install/lib. How to test and verify the libjpeg-turbo is built into opencv? Instead of system libjpeg.

ping chang
  • 35
  • 1
  • 4

1 Answers1

2

There should be a binary (executable) in your package called opencv_version, which you can run like this:

opencv_version -v | grep -i jpeg

Sample Output

JPEG:                        build-libjpeg-turbo (ver 1.5.3-62)
JPEG 2000:                   build (ver 1.900.1)

Equally, within Python, you can do:

import cv2
print(cv2.getBuildInformation())

Or, maybe more succinctly:

import cv2
import re                                                                                   

re.findall('.*jpeg.*',cv2.getBuildInformation())                               

Sample Output:

['    JPEG:                        build-libjpeg-turbo (ver 1.5.3-62)']
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • Thanks. Does any other differences between libjpeg-turbo and libjpeg? Such as the differences of the API of them, or the effect when use them in jpeg figure. – ping chang Dec 12 '19 at 02:26
  • And i also try to build `-D WITH_JPEG=ON -D BUILD_JPEG=OFF`. `./opencv_version -v |grep -i jpeg JPEG: libjpeg-turbo (ver 1.5.3-62) JPEG 2000: build (ver 1.900.1)` The output is the same as the build with `-D WITH_JPEG=ON -D BUILD_JPEG=ON`. – ping chang Dec 12 '19 at 02:32
  • I'm not sure what you are getting at. Are you using C++ or Python? Are you sure you are installing and using the version you are building? I believe the build will take the turbo version if present and the standard version if not. The API is unchanged between the two. – Mark Setchell Dec 12 '19 at 09:12
  • use c++. I am not a newer to cmake. I do these two tests at two directory. I check the process of `cmake ..` and CMakeCache.txt. It is `JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)` in standard build. The outputs of two tests are the same. `ttt/opencv-3.4.5/build/bin$ ./opencv_version -v |grep -i jpeg JPEG: libjpeg-turbo (ver 1.5.3-62) JPEG 2000: build (ver 1.900.1) ` – ping chang Dec 12 '19 at 11:55
  • Thanks. It may be the reason of my desktop. I do the standard build on another computer. `./opencv_version -v ` is as you said. But it is strange on my desktop. – ping chang Dec 12 '19 at 12:10