Monday, 14 September 2020

how to build a custom opencv.js with opencv_contrib

I would like to include xfeatures2D from opencv_contrib into opencv.js.

I follow this documentation Build OpenCV.js. Everything is ok. I got a brand new opencv.js that I'm able to use in my html page, but it doesn't include the xfeatures2D module.

I change this file opencv/platforms/js/build_js.py to add :

def get_cmake_cmd(self):
  cmd = ["cmake",
     "-DOPENCV_EXTRA_MODULES_PATH=/Users/me/git/opencv_contrib/modules",
     ... 

Now cmake include opencv_contrib module. I can see extra modules compiled, but still not included by emscripten. It looks like javascript compilation hardcoded into opencv/modules/js.

Is a way to produce his own opencv.js and choose to remove or add opencv and/or contribution modules ?

Thanks

Laurent



from how to build a custom opencv.js with opencv_contrib

No comments:

Post a Comment