https://github.com/webarkit/opencv-em
A simple utility script to build OpenCV static libs with Emscripten
https://github.com/webarkit/opencv-em
emscripten hacktoberfest opencv opencvjs wasm
Last synced: about 1 year ago
JSON representation
A simple utility script to build OpenCV static libs with Emscripten
- Host: GitHub
- URL: https://github.com/webarkit/opencv-em
- Owner: webarkit
- License: gpl-3.0
- Created: 2020-11-06T14:16:48.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-22T16:23:17.000Z (over 1 year ago)
- Last Synced: 2025-01-22T17:28:14.308Z (over 1 year ago)
- Topics: emscripten, hacktoberfest, opencv, opencvjs, wasm
- Language: Shell
- Homepage:
- Size: 72.3 KB
- Stars: 19
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# opencv-em
A simple script utility to build with Emscripten OpenCV static libs. You can build the libs by yourself or grab them from a [Release](https://github.com/webarkit/opencv-em/releases)
This project serves to build the OpenCV libraries for [WebARKitLib](https://github.com/webarkit/WebARKitLib/tree/dev), but it can be customized to suit your specific needs.
## Building OpenCV with Emscripten
If you want to build the libs, you need Emscripten. Install the emsdk as suggested in the [Emscripten website](https://emscripten.org/docs/getting_started/downloads.html). Then you can clone this repository:
```
git clone https://github.com/webarkit/opencv-em.git
```
you need also to init the OpenCV submodule:
```
git submodule update --init
```
Then you can run the build script (./build.sh) with either `linux` or `emscripten` configuration.
Note: If you'd like the include file structure to mimic a default OpenCV installation inside the generated archive for emscripten, you'll need to do both and start with a linux build:
```
./build.sh linux
```
Then, move on to the emscripten build:
```
./build.sh emscripten
```
## Pre-built binaries
You don't need to build the libs you can grab from [Releases](https://github.com/webarkit/opencv-em/releases)
## Use of pre-built binaries
You can use FetchContent in a cmake project (CMakeLists.txt):
```cmake
include(FetchContent)
FetchContent_Declare(
build_opencv
URL https://github.com/webarkit/opencv-em/releases/download/0.1.6/opencv-4.10.0.zip
)
FetchContent_MakeAvailable(build_opencv)
```
or you can use [curl](https://github.com/curl/curl) or [bootstrapping](https://github.com/corporateshark/bootstrapping) to download the package and make it available to your project.