hybridgroup / gocv

Go package for computer vision using OpenCV 4 and beyond. Includes support for DNN, CUDA, OpenCV Contrib, and OpenVINO.
https://gocv.io
Other
6.69k stars 866 forks source link

Automate wrapper functions? #858

Open kegsay opened 3 years ago

kegsay commented 3 years ago

Description

It seems fairly mechanical to add new functions that are on the roadmap. Do you think it is possible to automate the process of implementing wrapper functions @deadprogram ? It would save a lot of time in the long run and ensure this library remains up to date with the latest opencv.

My use case here is mainly because I want to use functions not yet defined, specifically calibrateCamera.

deadprogram commented 3 years ago

There were several attempts to do this, actually. I tried to do it with SWIG myself in one of them.

However, it became very complicated quickly due to complexity and some inconsistencies in the OpenCV code itself.

Check out the internal generator for the OpenCV Python bindings here: https://github.com/opencv/opencv/tree/master/modules/python

Hence we went with human-powered brute force conversion. But perhaps you might see some good way to to this, which would certainly be a good thing.

kegsay commented 3 years ago

Fab, thanks for the feedback. I guess if OpenCV maintains automatic generator bindings then at least in theory it's 100% doable, with enough SWIG wrangling. I'll ping back if I get anywhere with this.