English 中文(简体)
如何最小化 OpenCv 库大小?
原标题:How to minimize OpenCv library size?

我想尽可能缩小我和机器人的Dndk 所建图书馆的大小。

我从为安卓尔德预先建造的 OpenCv 图书馆开始,现在我的lib 大小大约是 3MB 。 我怎样才能将它最小化呢?

我只需要 OpenCv 的读/写文件能力、 png 编码/代码、 jpeg 解码器和典型图像处理功能, 如变大和 cvtColor 。

任何指点都非常感激!

问题回答

Jona,你可能已经继续你的计划了, 但是其他不使用 cmake-gui 的人可能会喜欢一个命令行示例。 也就是说, 如果您不想使用 CACLIB 模块, 您可以像这样构建 :

cmake - DBUILD_OPENCV_CACLIB=OFF [其他花旗]./

maniping building 旗可能无法覆盖您想要的所有模块排除范围, 但是, 它很可能是一个良好的起点 。 要查看国旗选项列表, 请打开 CMakeLists. txt 文件( 打开源目录的顶端 ) 。

开关/关闭旗帜也会打破你的建筑 和手动评论代码一样多

OpenCV 图书馆有多个模块模块, 您可以考虑将高吉和 gpu 等模块丢弃出去, 也许更多取决于您需要什么和不需要什么。 无论如何, 我不太确定您需要什么。 也许你应该使用另一个较小的图书馆, 因为阅读、 写写、 解码、 转换等等都不是计算机视野操作, 比如 Hough 变换或远程地图

一个你可能会想到的就是 cimg btw, 你可以很容易地将它脱下来, 因为它只是简单地定义了越来越多的函数 作为 cimg 类的一部分。

祝你好运!





相关问题
Python/OpenCV: Converting images taken from capture

I m trying to convert images taken from a capture (webcam) and do some processing on them with OpenCV, but I m having a difficult time.. When trying to convert the image to grayscale, the program ...

How to smooth a histogram?

I want to smooth a histogram. Therefore I tried to smooth the internal matrix of cvHistogram. typedef struct CvHistogram { int type; CvArr* bins; float thresh[CV_MAX_DIM][2]; /* ...

Testing complex datatypes?

What s are some ways of testing complex data types such as video, images, music, etc. I m using TDD and wonder are there alternatives to "gold file" testing for rendering algorithms. I understand that ...

Displaying OpenCV iplimage data structures with wxPython

Here is my current code (language is Python): newFrameImage = cv.QueryFrame(webcam) newFrameImageFile = cv.SaveImage("temp.jpg",newFrameImage) wxImage = wx.Image("temp.jpg", wx.BITMAP_TYPE_ANY)....

What is the memory structure of OpenCV s cvMat?

Imagine I have the following: CvMat* mat = cvCreateMat(3,3,CV_16SC3) This is a 3x3 matrix of integers of channel 3. Now if you look at OpenCV documentation you will find the following as the ...

Face detection and comparison

I m running a small research on face detection and comparison for my article. Currently, I m using rapid face detection based on haar like features based on OpenCV cascade (I ll implement learning ...

热门标签