Skip to content

opencv.js missing ArucoDetector, GridBoard, CharucoBoard #23723

@damianofalcioni

Description

@damianofalcioni

System Information

opencv.js version: 4.7.0
official build from https://github.com/opencv/opencv/releases/download/4.7.0/opencv-docs-4.7.0.zip

Detailed description

The classes ArucoDetector, GridBoard, and CharucoBoard, are not available in the opencv.js, despite being whitelisted in the opencv_js.config.py config file:

'ArucoDetector': ['getPredefinedDictionary', 'detectMarkers', 'refineDetectedMarkers', 'getDictionary', 'stetDictionary', 'getDetectorParameters', 'setDetectorParameters', 'getRefineParameters', 'setRefineParameters'],

'GridBoard': ['create','generateImage', 'getGridSize', 'getMarkerLength', 'getMarkerSeparation'],

'CharucoBoard': ['create', 'generateImage', 'getChessboardCorners', 'getNearestMarkerCorners', 'checkCharucoCornersCollinear']

Tests for such classes are also missing https://github.com/opencv/opencv/blob/master/modules/js/test/test_objdetect.js

Thanks

Steps to reproduce

Using node.JS code:

require('./opencv.js').then((cv)=>{
  console.log(cv.getBuildInformation()); // correctly show build informations
  let detector = new cv.ArucoDetector(); // generate runtime error of missing ArucoDetector constructor
});

output:

General configuration for OpenCV 4.7.0 =====================================
  Version control:               4.7.0

  Platform:
    Timestamp:                   2022-12-28T15:20:23Z
    Host:                        Linux 5.15.0-56-generic x86_64
    Target:                      Emscripten 1 x86
    CMake:                       3.10.2
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/make
    Configuration:               Release

  CPU/HW features:
    Baseline:

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/emsdk-portable/upstream/emscripten/em++  (ver 10.0.0)
    C++ flags (Release):         -s USE_PTHREADS=0    -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections 
 -fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG -O2  -DNDEBUG
    C++ flags (Debug):           -s USE_PTHREADS=0    -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections 
 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/emsdk-portable/upstream/emscripten/emcc
    C flags (Release):           -s USE_PTHREADS=0    -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections 
 -fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG -O2  -DNDEBUG
    C flags (Debug):             -s USE_PTHREADS=0    -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections 
 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,--gc-sections -Wl,--no-undefined -O2
    Linker flags (Debug):        -Wl,--gc-sections -Wl,--no-undefined
    ccache:                      NO
    Precompiled headers:         NO
    Extra dependencies:
    3rdparty dependencies:       zlib libprotobuf quirc

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann imgproc js objdetect photo video
    Disabled:                    highgui imgcodecs ml stitching videoio world
    Disabled by dependency:      ts
    Unavailable:                 gapi java python2 python3
    Applications:                examples
    Documentation:               js
    Non-free algorithms:         NO

  GUI:

  Media I/O:
    ZLib:                        build (ver 1.2.13)
    JPEG 2000:                   build (ver 2.4.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:

  Parallel framework:            none

  Other third-party libraries:
    VA:                          NO
    Custom HAL:                  NO
    Protobuf:                    build (3.19.1)

  Python (for build):            /usr/bin/python

  Install to:                    /usr/local
-----------------------------------------------------------------


RuntimeError: abort(TypeError: cv.ArucoDetector is not a constructor)

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions