如何使用opencv_contrib构建自定义的opencv.js [英] How to build a custom opencv.js with opencv_contrib

查看:184
本文介绍了如何使用opencv_contrib构建自定义的opencv.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将来自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_js You 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆