diff --git a/modules/js/src/core_bindings.cpp b/modules/js/src/core_bindings.cpp index 1617c09a64..4f80866b2d 100644 --- a/modules/js/src/core_bindings.cpp +++ b/modules/js/src/core_bindings.cpp @@ -107,6 +107,10 @@ typedef SimpleBlobDetector::Params SimpleBlobDetector_Params; typedef TrackerMIL::Params TrackerMIL_Params; #endif +#ifdef HAVE_OPENCV_XIMGPROC +typedef ximgproc::EdgeDrawing::Params EdgeDrawing_Params; +#endif + // HACK: JS generator ommits namespace for parameter types for some reason. Added typedef to handle std::string correctly typedef std::string string; diff --git a/platforms/js/build_js.py b/platforms/js/build_js.py index 0eb0a946c0..3f51f6c5e1 100644 --- a/platforms/js/build_js.py +++ b/platforms/js/build_js.py @@ -175,6 +175,10 @@ class Builder: if flags: cmd += ["-DCMAKE_C_FLAGS='%s'" % flags, "-DCMAKE_CXX_FLAGS='%s'" % flags] + + if self.options.extra_modules: + cmd.append("-DOPENCV_EXTRA_MODULES_PATH='%s'" % self.options.extra_modules) + return cmd def get_build_flags(self): @@ -260,6 +264,8 @@ if __name__ == "__main__": # Write a path to modify file like argument of this flag parser.add_argument('--config', help="Specify configuration file with own list of exported into JS functions") parser.add_argument('--webnn', action="store_true", help="Enable WebNN Backend") + parser.add_argument("--extra_modules", required=False, help="Path extra modules location (OPENCV_EXTRA_MODULES_PATH)") + transformed_args = ["--cmake_option={}".format(arg) if arg[:2] == "-D" else arg for arg in sys.argv[1:]] args = parser.parse_args(transformed_args)