From 27d15894d81fdae05359adcd242d22232a8088df Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Thu, 3 Jan 2019 18:50:36 +0100 Subject: [PATCH 1/2] js: allow building without dnn --- modules/js/src/core_bindings.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/js/src/core_bindings.cpp b/modules/js/src/core_bindings.cpp index b00bfb0d5f..c48ffb966c 100644 --- a/modules/js/src/core_bindings.cpp +++ b/modules/js/src/core_bindings.cpp @@ -74,7 +74,11 @@ using namespace emscripten; using namespace cv; + +#ifdef HAVE_OPENCV_DNN using namespace dnn; +#endif + namespace binding_utils { From 2f89158339bdf131dacf35e22f891abde0b49ed3 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Thu, 3 Jan 2019 18:58:55 +0100 Subject: [PATCH 2/2] js: allow building with basic aruco functionality --- modules/js/src/core_bindings.cpp | 3 +++ modules/js/src/embindgen.py | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/js/src/core_bindings.cpp b/modules/js/src/core_bindings.cpp index c48ffb966c..554f95aa83 100644 --- a/modules/js/src/core_bindings.cpp +++ b/modules/js/src/core_bindings.cpp @@ -79,6 +79,9 @@ using namespace cv; using namespace dnn; #endif +#ifdef HAVE_OPENCV_ARUCO +using namespace aruco; +#endif namespace binding_utils { diff --git a/modules/js/src/embindgen.py b/modules/js/src/embindgen.py index 3a7a977774..8e406e0388 100644 --- a/modules/js/src/embindgen.py +++ b/modules/js/src/embindgen.py @@ -163,6 +163,13 @@ photo = {'': ['createAlignMTB', 'createCalibrateDebevec', 'createCalibrateRobert 'getColorAdaptation', 'setColorAdaptation'] } +aruco = {'': ['detectMarkers', 'drawDetectedMarkers', 'drawAxis', 'estimatePoseSingleMarkers', 'estimatePoseBoard', 'interpolateCornersCharuco', 'drawDetectedCornersCharuco'], + 'aruco_Dictionary': ['get', 'drawMarker'], + 'aruco_Board': ['create'], + 'aruco_GridBoard': ['create', 'draw'], + 'aruco_CharucoBoard': ['create', 'draw'], + } + def makeWhiteList(module_list): wl = {} for m in module_list: @@ -173,7 +180,7 @@ def makeWhiteList(module_list): wl[k] = m[k] return wl -white_list = makeWhiteList([core, imgproc, objdetect, video, dnn, features2d, photo]) +white_list = makeWhiteList([core, imgproc, objdetect, video, dnn, features2d, photo, aruco]) # Features to be exported export_enums = False