我正在尝试在linux上设置OPENCV.js.但是我在Empscripten路径上遇到了令人愤怒的问题。 我正在关注此文档:https://docs.opencv.org/3.3.1/d4/da1/tutorial_js_setup.html
1-)我下载empscripten并执行以下代码。
./emsdk update
./emsdk install latest
./emsdk activate latest
2-)设置环境路径
source ./emsdk_env.sh
3-)用git克隆opencv
git clone https://github.com/opencv/opencv.git
4-)构建此目录(/ root / Downloads / opencvjspackage)
python ./platforms/js/build_js.py /root/Downloads/opencvjspackage
我在第4部分得到了这个输出
root@kali:~/Downloads/opencvjs/opencv# python ./platforms/js/build_js.py /root/Downloads/opencvjspackage
Args: Namespace(build_dir='/root/Downloads/opencvjspackage', build_doc=False, build_test=False, build_wasm=False, clean_build_dir=False, config_only=False, emscripten_dir=None, enable_exception=False, opencv_dir='/root/Downloads/opencvjs/opencv', skip_config=False)
Cannot get Emscripten path, please specify it either by EMSCRIPTEN environment variable or --emscripten_dir option.
我试试这个
python ./platforms/js/build_js.py /root/Downloads/opencvjspackage --emscripten_dir=/root/Downloads/emsdk-portable/emscripten/1.37.33
获得此输出:
usage: build_js.py [-h] [--opencv_dir OPENCV_DIR]
[--emscripten_dir EMSCRIPTEN_DIR] [--build_wasm]
[--build_test] [--build_doc] [--clean_build_dir]
[--skip_config] [--config_only] [--enable_exception]
build_dir
build_js.py: error: too few arguments
答案 0 :(得分:1)
=
和Empscripten路径之间不应该有--emscripten_dir
。输出文件夹也应该是最后一个参数。
试试这样:
python ./platforms/js/build_js.py --emscripten_dir /root/Downloads/emsdk-portable/emscripten/1.37.33 /root/Downloads/opencvjspackage
提示:确保/root/Downloads/opencvjspackage
存在,并且您希望将opencv.js
置于其中。还要确保已安装cmake
。