PLT Racket 中的 FFI 与 openCV
我想通过 PLT Racket 控制我的网络摄像头,最好为 OpenCV 的一些 C api 制作一个轻量级包装库。不过,我遇到了一点麻烦,因为我不确定 OpenCV 中的哪些目标文件是库……我知道,这很尴尬。我查看了 Python API 的工作原理,发现 cv.so 文件中包含模块,但我不确定在二进制文件中使用什么。我在 Mac OSX 上
有这个
(get-ffi-obj function-name (ffi-lib lib-name) format)...)
,但我不确定将哪个文件作为“lib-name”传递。 在我的 opencv 安装目录中,我有 ../opencv/2.2/lib 其中包含许多 .dylib 文件。似乎都不起作用,但它们是迄今为止最好的猜测。我需要使用不同的编译器选项构建 OpenCV 吗?
I'd like to control my webcam through PLT Racket, and ideally to make a light wrapper library for some of OpenCV's C api. I'm having a little trouble, though, in that I'm not sure which object files from OpenCV are the libraries... embarrassing, I know. I looked at how the Python API is working, and I see that the modules there are in the cv.so file, but I'm not sure what to use in my binaries. I'm on Mac OSX
I have this
(get-ffi-obj function-name (ffi-lib lib-name) format)...)
but I'm not sure which file to pass as "lib-name".
In my installation directory for opencv I have ../opencv/2.2/lib which contains a number of .dylib files. None seem to work, but they are the best guess so far. Do I need to build OpenCV with different compiler options?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,在 OSX
.dylib
文件上就是这些(动态)库。在 Windows 上它们是.dll
文件,在 Linux 上它们是.so
文件。请注意,ffi-lib 会进行一些搜索,以便您可以使用单个名称,并且它将使用系统的工具(例如,dlopen()
)来查找库。Yes, on OSX
.dylib
files are these (dynamic) libraries. On windows they would be.dll
files and on linux.so
. Note thatffi-lib
does some searching so you can use a single name and it will use the system's facility (eg,dlopen()
) to look for a library.