I use OpenCV and its Python wrappers on a daily basis to produce computer vision algorithms.
For several complex functions, we need to keep the C version which allows lower computation time and easier reuse.
In this way, I would like to bind C functions that use opencv structures like iplimage to use them in Python. Could you give me some tips on it? I
don’t really know where to start actually.
Here is my structure which contains iplimages.
typedef struct{
int nbBlobs;
IplImage *labels;
IplImage *contours;
}ccl_conf_t;
And here are the propotypes of my function:
int ccl_init(ccl_conf_t *conf, IplImage *frame);
void ccl_unInit(ccl_conf_t *conf);
int ccl_label(ccl_conf_t *conf, IplImage *frame, int option);
I would be grateful for any hint you could give me!
Making a Python loadable module in C is quite easy. Start here: http://docs.python.org/c-api/
It’s easy to take a small example from the Python source itself, extend to your own use. Look in the ‘Modules’ dir of the Python source.