How to check the libjpeg-turbo is built into opencv?

僤鯓⒐⒋嵵緔 提交于 2020-08-09 12:04:09

问题


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.


回答1:


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)']


来源:https://stackoverflow.com/questions/59280235/how-to-check-the-libjpeg-turbo-is-built-into-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!