本文介绍了如何检查 libjpeg-turbo 是否内置在 opencv 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 github 下载了 opencv3.4.5 https://github.com/opencv/opencv/archive/3.4.5.zip.libjpeg-turbo 位于 3rdparty 目录.并添加 -D WITH_JPEG=ON-D BUILD_JPEG=ON 构建它.我可以在 CMakeCache.txt 中检查这个.但是我在 install/include 或 install/lib 中找不到任何与 libjpeg-turbo 相关的东西.如何测试和验证 libjpeg-turbo 内置于 opencv 中?而不是系统 libjpeg.

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.

推荐答案

你的包中应该有一个名为 opencv_version 的二进制文件(可执行文件),你可以这样运行:

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

opencv_version -v | grep -i jpeg

样本输出

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

同样,在 Python 中,您可以:


Equally, within Python, you can do:

import cv2
print(cv2.getBuildInformation())

或者,也许更简洁:

import cv2
import re

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

样本输出:

['    JPEG:                        build-libjpeg-turbo (ver 1.5.3-62)']

这篇关于如何检查 libjpeg-turbo 是否内置在 opencv 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 06:49