- Install emscripten
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 2.0.8
./emsdk activate 2.0.8
./emsdk_env.sh
- Download and extract ncnn & OpenCV
Directory Tree
├─assets
├─demo
├─include
├─ncnn-static
│ └─webassembly
│ ├─basic
│ ├─simd
│ ├─simd-threads
│ └─threads
├─opencv-static
│ └─webassembly
│ ├─bin
│ ├─include
│ ├─lib
│ └─share
└─src
and
Get missing opencv2/imgcodecs.hpp
Link
Path: opencv-static/webassembly/include/opencv2
- Build
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/PATH_TO_EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Release -DOCR_STATIC=ON ..
make
demo/index.html
demo/arknights.html