Cannot load Virtual Class ( Tracking Algorithm ) in Compiled OpenCV.js

What I have:
I successfully compile opencvjs using this version

  • OpenCV : 4.5.4
  • Opencv-Contrib : 4.5.4
  • emscripten : 2.0.10

Setup what I had done:

  • In opencv/modules/js/src/core_bindings.cpp add opencv/modules/js/src/core_bindings.cpp
  • In opencv/platforms/js/ Add "-DBUILD_opencv_tracking=ON"
  • In opencv/platforms/js/ add
tracking = {
  "Tracker": ["init", "update"],
  "Tracker_KCF": ["create"],
  "Tracker_Boosting": ["create"],
  "Tracker_MIL": ["create"],
  "Tracker_TLD": ["create"],
  "Tracker_MedianFlow": ["create"],
  "Tracker_MOSSE": ["create"],
  "Tracker_CSRT": ["create"]}
  • Add tracking to white_list
  • In opencv_contrib/modules/tracking/CMakeLists.txt Add js parameter in ocv_define_module

Compile Result:
All going well. No error.

Compiled Script:
compiled opencv.js can be loaded to the html file or test by node js.


Any tracking algorithm from the tracking method cannot be load by opencv.js.

Current Finding:
I realized that, All of tracking algorithm in opencv was located under Virtual Class. Does this really cause the problem?

Or there are other problem which caused the error?

Any information will be helpful!
Thank you.

please have a look at this recent pr