Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help install #4

Open
vardenko12 opened this issue Dec 29, 2020 · 4 comments
Open

Help install #4

vardenko12 opened this issue Dec 29, 2020 · 4 comments

Comments

@vardenko12
Copy link

Please help me build this assembly.

Also, please help me, if possible, add a web worker to this assembly.

I am ready to pay for your work. Write to TG: @ vardenko1

@EdwardLu2018
Copy link
Owner

EdwardLu2018 commented Dec 29, 2020

Sure. What do you need help on?

First step is to download and install emsdk:

git clone https://github.com/emscripten-core/emsdk
cd emsdk
./emsdk update
./emsdk install 1.39.16
./emsdk activate 1.39.16

Next, instead of building opencv, you can use opencv-em, made by the lovely folks at webarkit: https://gist.github.com/kalwalt/a5fb9230f21b9e39f6fbc872cf20c376

OR you can build opencv_js: https://docs.opencv.org/master/d4/da1/tutorial_js_setup.html

After all this, run ./build.sh

I am working on adding a web worker.

@stevanusdk
Copy link

stevanusdk commented Dec 20, 2023

Hi @EdwardLu2018

amazing, I am also looking at how to build the CPP code with OpenCV files (like your img_tracker_wasm.cpp),
when I run build.sh, it gives me the error wasm-ar/emscripten/img_tracker_wasm.cpp:5:10: fatal error: 'opencv2/opencv.hpp' file not found, may I know if there is anything that I miss?

Note:
I am using Emscripten v.3.1.34,
but changed to v. 1.39.16, it produce the same error,

[ 33%] Building CXX object CMakeFiles/img_tracker_wasm.dir/emscripten/img_tracker_wasm.cpp.o
../wasm-ar/emscripten/img_tracker_wasm.cpp:5:10: fatal error: 'opencv2/opencv.hpp' file not found
#include <opencv2/opencv.hpp>
^~~~~~~~~~~~~~~~~~~~

@EdwardLu2018
Copy link
Owner

EdwardLu2018 commented Dec 20, 2023

You should build opencv_wasm from source. The opencv-em way is a bit outdated. Then it should work with latest version of emsdk:

git clone git@github.com:opencv/opencv.git
cd opencv
python3 ./platforms/js/build_js.py build_wasm --build_wasm

I updated the README. Been while since I've worked on this repo, so many things may be out of date...
Feel free to make a PR if you get it working and I missed something!

@hexwhyzet
Copy link

hexwhyzet commented Sep 24, 2024

Hi, could explain, please, what should I make with folder build_wasm that I got after building opencv to build project? Where should I place it? Or should I write sudo make install?

I tried to place opencv inside your project, and build_wasm inside opencv, but I got new error

In file included from /home/kabakov/webasm/wasm-ar/emscripten/img_tracker_wasm.cpp:5:
/home/kabakov/webasm/wasm-ar/opencv/include/opencv2/opencv.hpp:52:10: fatal error: 'opencv2/core.hpp' file not found
   52 | #include "opencv2/core.hpp"
      |          ^~~~~~~~~~~~~~~~~~
1 error generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants