由于签名中的原始rect指针,opencv.js似乎没有公开洪水填充。
基于此answer,我尝试从黑名单中删除FloodFilling,将其列入白名单,然后在imgproc.hpp的第3587行上添加
floodFilling的包装器签名(从答案中粘贴副本):
// special overload for js:
CV_EXPORTS_W int floodFill( InputOutputArray image, InputOutputArray mask,
Point seedPoint, Scalar newVal) {
return floodFill(image, mask, seePoint, newVal, 0);
}
但是这失败并显示错误:
opencv/build_js/modules/js/bindings.cpp:1326:16: error: call to 'floodFill' is ambiguous
return cv::floodFill(arg1, arg2, arg3, arg4);
如果我完全移除了包装器,则该函数将在javascript中可用并且可以调用,但是会引发未定义的异常。
我试图更改包装器的签名,以使用其他虚拟int,字符串,浮点型和自定义结构,但它们均无法编译。
有人能向JS公开FloodFilling吗?