From f79307334847947a7d259c9c6ac0e915ef4949c4 Mon Sep 17 00:00:00 2001 From: frank Date: Tue, 25 Apr 2023 23:17:13 -0400 Subject: [PATCH] full example for building opencv libraries; upgrade box demo SDL version --- README.md | 25 +++++++++++++++++++++++++ demo/box/Makefile | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7847ddc..31a063b 100644 --- a/README.md +++ b/README.md @@ -317,6 +317,31 @@ To link to the WASM libraries, add the `*.a` files from the build directory to E $(wildcard $(addprefix $(WASM_BUILD_DIR)/lib/,*.a)) $(wildcard $(addprefix $(WASM_BUILD_DIR)/3rdparty/lib/,*.a)) +#### Full example + +This builds both the local and WASM libraries by downloading OpenCV 4.7.0 and the contributed modules source packages. See [Gunkiss][] for an example of using these libraries in a project. + + $ wget https://github.com/opencv/opencv/archive/4.7.0.zip + $ unzip 4.7.0.zip + $ tar -xf opencv_contrib-4.7.0.tar.gz + $ mkdir opencv_contrib-4.7.0-subset + $ cp -r opencv_contrib-4.7.0/modules/barcode/ opencv_contrib-4.7.0-subset/ + $ rm -rf ~/local/opencv/ + $ cd opencv-4.7.0/ + $ mkdir build_linux + $ cd build_linux/ + $ cmake -D CMAKE_INSTALL_PREFIX=$HOME/local/opencv -D OPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-4.7.0-subset/" .. + ... + -- OpenCV modules: + -- To be built: barcode calib3d core dnn features2d flann gapi highgui imgcodecs imgproc java ml objdetect + photo python3 stitching ts video videoio + ... + $ make -j3 && make install + $ cd .. + $ source ~/ext/software/emsdk/emsdk_env.sh + $ python3 platforms/js/build_js.py --cmake_option="-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.7.0-subset/" \ + --emscripten_dir ~/ext/software/emsdk/upstream/emscripten build_wasm_contrib --build_wasm + ### ZBar #### Linux diff --git a/demo/box/Makefile b/demo/box/Makefile index e598a59..240b0bd 100644 --- a/demo/box/Makefile +++ b/demo/box/Makefile @@ -120,7 +120,7 @@ box_demo.js: $(addprefix $(SDLGFX2_DIR),SDL2_rotozoom.o SDL2_gfxPrimitives.o) $( # . The project source files are assumed to be just `$(SRC_DIR)/*.cpp`. If that is not the case, the revise_skeleton.sh script # must be edited. -SDL_SRC := $(HOME)/ext/software/SDL2-2.24.0-android +SDL_SRC := $(HOME)/ext/software/SDL2-2.26.3 SDL_IMAGE_SRC := $(HOME)/ext/software/SDL2_image-2.6.2-android SDL_MIXER_SRC := $(HOME)/ext/software/SDL2_mixer-2.6.2-android SDL_TTF_SRC := $(HOME)/ext/software/SDL2_ttf-2.20.1-android