简体   繁体   中英

FFI in PLT Racket with 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?

Yes, on OSX .dylib files are these (dynamic) libraries. On windows they would be .dll files and on linux .so . Note that ffi-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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM