Adding packages to Javascript WASM build
Hi,
I'm using the Javascript WASM build target, and I wanted to expose more functionality. Exposing more methods in the existing packages (core, etc) is straightforward (i.e., I added "rotate" easily).
I wanted to try and add one of the opencv_contrib modules, and can't figure out how to do it.
I added a line to the embindgen.py file for aruco, and added aruco to the white_list in the file.
aruco = {'aruco': ['detectMarkers', 'estimatePoseSingleMarkers', 'drawDetectedMarkers', 'drawAxis']}
The instructions for building the contrib modules assume you are building with CMAKE on the command line; I tried adding the appropriate flags to the build_js.py file, but couldn't seem to make it build any of the contrib modules (i.e., it didn't affect the resulting build).
I am trying it out with the aruco module. I also tried moving the aruco folder in the main opencv/modules. Here the build made some progress, showing me that it wasn't including it because of missing dependency (calib3d); so I changed the calib3d flag to ON in build_py.sh, and got output during the config that seems to say it is going to try and build aruco:
-- OpenCV modules:
-- To be built: aruco bgsegm bioinspired calib3d core dnn dnn_objdetect dpm features2d fuzzy hfs img_hash imgproc java_bindings_generator js line_descriptor objdetect phase_unwrapping plot python_bindings_generator reg rgbd saliency stereo structured_light tracking video xfeatures2d xphoto
-- Disabled: flann highgui imgcodecs ml photo shape stitching superres videoio videostab world
-- Disabled by dependency: ccalib datasets face optflow surface_matching text ximgproc xobjdetect
-- Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv dnn_modern freetype hdf java matlab ovis python2 python3 sfm ts viz
-- Applications: -
-- Documentation: js
-- Non-free algorithms: NO
But, after that, it doesn't try to build that library. I hope it's something simply I'm doing wrong, I don't have much experience building opencv