1. OpenCV and Eu

I was thinking about doing a vision project with OpenCV and Eu. I've used OpenCV previously for a small project but have never attempted to wrap it for native use in Euphoria.

Has anyone looked into this before? I didn't find anything in the archives or forum. Also, OpenCV is a fairly large project; what are the important considerations for tackling such a task?

Thanks,
Ira

new topic     » topic index » view message » categorize

2. Re: OpenCV and Eu

Jerome said...

I was thinking about doing a vision project with OpenCV and Eu. I've used OpenCV previously for a small project but have never attempted to wrap it for native use in Euphoria.

Has anyone looked into this before? I didn't find anything in the archives or forum. Also, OpenCV is a fairly large project; what are the important considerations for tackling such a task?

Thanks,
Ira

I don't think anyone's wrapped OpenCV before, but it seems to have a plain old C interface, which should be relatively straight-forward to wrap in Euphoria. Here are a few things to consider when wrapping any C library:

  • Get a good overview of what you're wrapping before you start. Look all the data types, functions, and structures to help prevent surprises down the road. Sometimes I run across a structure or function that turns me off of wrapping a library due to extensive and/or nasty C-isms. Matt's been working on "memstructs" for Euphoria, which will almost certainly make wrapping C libraries much easier.
  • Collect all the data type definitions and list them next to their Euphoria C_TYPE constants. This will make wrapping easier and more consistent as you move forward. Remember that parameters prefixed with an asterisk (*) are pointers, so you need to use C_POINTER instead of their declared type, and then account for that type in your wrapper function.
  • You may want to wrap everything in two stages. A lot of C functions pass return values back via pointers in the parameter of a function, with an error code (or zero) returned directly, whereas Euphoria functions accept parameters and return everything back as one value. So first build a low-level direct wrapping of each function, and then a high-level Euphoria-esque set of functions. This is how libraries like Win32Lib and wxEuphoria work. Given the size, nature, and complexity of OpenCV, this may be a good idea.

Hope that helps. I may come up with more tips. Hopefully others will chime in as well.

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: OpenCV and Eu

ghaberek said...

Hope that helps. I may come up with more tips. Hopefully others will chime in as well.

Thanks for the tips! I recently got a Kinect sensor and there are a few projects I'd like to try with OpenCV and Euphoria. If/when I get everything wrapped, I'll make sure to get it onto rapideuphoria.com.

Thanks,
Ira

new topic     » goto parent     » topic index » view message » categorize

4. Re: OpenCV and Eu

just uploaded a wrapper for OpenCV 1.0 that I wrote mid last year.

currently in temporary upload area

see : http://www.rapideuphoria.com/uploads/opencv1.0.zip

may take a few hours to appear on main site front page

enjoy!

new topic     » goto parent     » topic index » view message » categorize

5. Re: OpenCV and Eu

raseu said...

just uploaded a wrapper for OpenCV 1.0 that I wrote mid last year.

Thank you! It looks like it will need some work to make it compatible with OpenCV 2.3, but this is an excellent starting place.

Thanks again,
Ira

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu