-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrappers for opencv #110
Comments
Low level deimos-like wrapper should be located in |
@timotheecour Thanks for bringing this up. I too agree we should make nice wrappers for opencv. And like opencv's python wrapper uses numpy.array natively, so should our wrapper use ndslice, as @9il points out.
Hmm, how about having I would propose the following - have low-level (opencv's c++ interface bind, maybe with SWIG) in |
We can have 3 levels the same way as with lubeck
For DCV it should looks like:
|
mir-lapack and mir-blas are selective too. |
maybe it's better to discuss this with a concrete example, say detectMultiScale from http://docs.opencv.org/2.4/modules/objdetect/doc/cascade_classification.html?highlight=detectmultiscale#cascadeclassifier-detectmultiscale
maybe in libmir/opencv or libmir/swig-opencv
maybe libmir/opencv or libmir/mir-opencv
There's already API choices that need to be made in this simple example:
maybe in libmir/dcv:
|
How it is implemented in Python bindings? |
swig http://answers.opencv.org/question/6618/how-python-api-is-generated/ however, it's possible to wrap opencv via swig; I did that at some point (for whatever functions from opencv I needed), it was painful to get it right but it can be done (and pays off because it's automatic). Here's an example of another project going that route: https://github.com/renatoGarcia/opencv-swig |
Not really. This answer is old but I doubt they've changed much. boost::python::numpy is worth a look. Maybe something like this should be done via PyD for ndslice? |
|
Besides manual (via https://forum.dlang.org/post/[email protected] Calypso: Direct and full interfacing to C++ http://www.digitalmars.com/d/archives/digitalmars/D/Calypso_and_the_future_of_D_253820.html#N253820 digitalmars.D - Calypso and the future of D |
Wow, Calypso is active! |
Also relevant discussion: https://internals.rust-lang.org/t/interfacing-d-to-legacy-c-code-a-summary-of-a-competing-languages-capabilities/1406 + video from walter bright: https://www.youtube.com/watch?v=IkwaV6k6BmM + slides http://walterbright.com/cppint.pdf In any case, investing in an automatic solution is the right thing to do (pays down the line) |
@timotheecour is this publicly available? |
not at the moment unfortunately. Would be happy to contribute on this though if that approach is considered |
a lot of bugs have recently been fixed in calypso making non-trivial opencv programs work in D, so IMO this should be preferred way forward |
Do you have some working examples of opencv with D and Calypso? |
IMO providing good integration with opencv will be key to dcv's success. The idea is to get quickly to a point where dcv has enough features to be useful for production use without waiting for opencv algorithms to be reimplemented. Some of these algorithms can in a later stage, if needed, be reimplemented as drop-in replacement for the opencv ones, maybe in some cases without changing public APIs.
I have done something like this using SWIG to auto-generate wrappers for a large portion of opencv (intermediate layer) along with higher-level idiomatic D layer and a tensor class that could be (shallow copy) converted to/from cv::Mat_.
For dcv one could either use swig or take advantage of the newer
extern(C++,ns)
syntax, and provide shallow conversion from Slice to/from cv::Mat_.Happy to discuss this further.
The text was updated successfully, but these errors were encountered: