Skip to content

Building WSAM modules for imgcodecs and other modules that isn't default #27531

@lihailewodedai

Description

@lihailewodedai

Hi, I was trying to build wsam libraries for my cpp application which is compiled by emscripten. I tried building OpenCV from source using the follwoing resource

https://docs.opencv.org/3.4/d4/da1/tutorial_js_setup.html

source ~/emsdk/emsdk_env.sh

emcmake python3 /opencv/platforms/js/build_js.py \
    /build \
    --build_wasm \
    --clean_build_dir \

but the default modules only contains
calib3d, core, dnn, features2s, flann, imgproc, objdetect, photo, video.

I wanted the imread for reading files from local repository to be usable which exists in imgcodecs I believe.
I tried changing the arguments within build_js.py by switching the default executable under get_cmake_cmd for
-DBUILD_opencv_imgcodecs=ON, but that only generates a folder under modules and not building the required .a library file which I believe I need. I also tried whitelisting trhough adding cmake option arguments for the python3 command --cmake_option=-DBUILD_LIST=core,imgproc,features2d,imgcodecs,highgui \ which seems to be failing because whitelisting does not build 3rd party library zlib and I couldn't figure out how to buiold zlib with white listing too.

for modifying the python build file, I do get the following from terminal output yet no .a file is produced for either highgui or imgcodecs

--   OpenCV modules:
--     To be built:                 calib3d core dnn features2d flann highgui imgcodecs imgproc js objdetect photo video
--     Disabled:                    ml stitching videoio world
...
...

Any advice for this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions