Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 955
Laurent Trillaud Avatar asked Nov 05 '18 09:11

Laurent Trillaud


Video Answer


1 Answers

I've spotted a repo which looks promising: https://github.com/ganwenyao/opencv_js You can even try a few aruco demos here: https://ganwenyao.github.io/opencv_js/

It doesn't include xfeature2d already compiled but it's worth trying the same approach listed the repo's README.

like image 129
George Profenza Avatar answered Sep 20 '22 12:09

George Profenza