Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Add new function signature for python and js in OpenCV

I've updated the grabCut function (opencv-master/modules/imgproc/src/grabcut.cpp) and also added some new functions in the imageproc module. For that I've updated the opencv-master/modules/imgproc/include/opencv2/imgproc.hpp file as:

CV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, OutputArrayOfArrays contour, Rect rect,
                           InputOutputArray bgdModel, InputOutputArray fgdModel,
                           int iterCount, int mode = GC_EVAL );

CV_EXPORTS_W void grabCut_slim( InputArray img, InputOutputArray mask,OutputArrayOfArrays contour, Rect rect,
                               InputOutputArray bgdModel, InputOutputArray fgdModel,
                               int iterCount, int mode = GC_EVAL );


CV_EXPORTS_W void paintselection( InputArray img, InputOutputArray mask,OutputArrayOfArrays contour,
                          InputOutputArray bgdModel, InputOutputArray fgdModel,
                          int iterCount, int mode = GC_EVAL );

CV_EXPORTS_W void paintselection_slim( InputArray img, InputOutputArray mask,OutputArrayOfArrays contour,
                               InputOutputArray bgdModel, InputOutputArray fgdModel,
                               int iterCount, int mode = GC_EVAL );

Doing that I'm able to use the updated function in c++. Now I want to use these updated functions in both python and js, how to do that ?

Add new function signature for python and js in OpenCV

I've updated the grabCut function (opencv-master/modules/imgproc/src/grabcut.cpp) and also added some new functions in the imageproc module. For that I've updated the opencv-master/modules/imgproc/include/opencv2/imgproc.hpp file as:

CV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, OutputArrayOfArrays contour, Rect rect,
                           InputOutputArray bgdModel, InputOutputArray fgdModel,
                           int iterCount, int mode = GC_EVAL );

CV_EXPORTS_W void grabCut_slim( InputArray img, InputOutputArray mask,OutputArrayOfArrays contour, Rect rect,
                               InputOutputArray bgdModel, InputOutputArray fgdModel,
                               int iterCount, int mode = GC_EVAL );


CV_EXPORTS_W void paintselection( InputArray img, InputOutputArray mask,OutputArrayOfArrays contour,
                          InputOutputArray bgdModel, InputOutputArray fgdModel,
                          int iterCount, int mode = GC_EVAL );

CV_EXPORTS_W void paintselection_slim( InputArray img, InputOutputArray mask,OutputArrayOfArrays contour,
                               InputOutputArray bgdModel, InputOutputArray fgdModel,
                               int iterCount, int mode = GC_EVAL );

Doing that I'm able to use the updated function in c++. Now I want to use these updated functions in both python and js, how to do that ?