问题描述
我想将来自opencv_contrib的xfeatures2D包含到opencv.js中.
I would like to include xfeatures2D from opencv_contrib into opencv.js.
我遵循此文档构建OpenCV.js .一切都好.我有一个可以在html页面中使用的全新opencv.js,但其中不包含xfeatures2D模块.
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.
我将此文件opencv/platforms/js/build_js.py更改为添加:
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",
...
现在cmake包含opencv_contrib模块.我可以看到已编译的其他模块,但emscripten仍未包括在内.看起来像JavaScript编译硬编码到opencv/modules/js中.
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.
是否可以生成自己的opencv.js并选择删除或添加opencv和/或贡献模块?
Is a way to produce his own opencv.js and choose to remove or add opencv and/or contribution modules ?
推荐答案
我发现了一个看起来很有前途的仓库: https://github.com/ganwenyao/opencv_js 您甚至可以在此处尝试一些 aruco
演示: https://ganwenyao.github.io/opencv_js/
I've spotted a repo which looks promising: https://github.com/ganwenyao/opencv_jsYou can even try a few aruco
demos here: https://ganwenyao.github.io/opencv_js/
它不包括已经编译的 xfeature2d
,但是值得尝试使用仓库中自述文件中列出的相同方法.
It doesn't include xfeature2d
already compiled but it's worth trying the same approach listed the repo's README.
这篇关于如何使用opencv_contrib构建自定义的opencv.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!