How do I compile a C program that contains a OPENCV header file?h
What can I do to include a custom OPENCV and then use EMCC to package it into a wasm file?
What can I do to include a custom OPENCV and then use EMCC to package it into a wasm file?
I am doing it pretty normally with CMake build system. Just rember to compile OpenCV also with emcc and you will be fine.
Thank you for your reply.Could you tell you the step?
this is my command
emcc -O2 ss.bc -o project.js -s WASM=1 -O3 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'cwrap']" -s EXPORTED_FUNCTIONS="['_int_sqrt']"
#include "opencv2/imgcodecs/imgcodecs.hpp"
#include <emscripten/emscripten.h>
using namespace cv;
extern "C" {
int int_sqrt(int x) {
IplImage *src = cvLoadImage("./a.png", 1);
IplImage *dst = cvCreateImage(CvSize(src->width, src->height), src->depth, src->nChannels);
//cvSobel(src, dst, 0, 1, 7);
cvSobel(src, dst, 0, 1, CV_SCHARR);
cvShowImage("dst", dst);
return 0;
}
}
error info:warning: unresolved symbol: cvCreateImage
Did you compile OpenCV with emcc? https://docs.opencv.org/3.4.0/d4/da1/... Besides loading with cvLoadImage will probably not work so easily with WebAssmebly. You need to take care of the filesystem virtualization https://kripken.github.io/emscripten-...
Asked: 2018-08-07 09:54:59 -0600
Seen: 560 times
Last updated: Aug 08 '18
build problems for android_binary_package - Eclipse Indigo, Ubuntu 12.04
OpenCV-2.4.2-android-sdk missing build.xml?
Area of a single pixel object in OpenCV
OpenCV DescriptorMatcher matches
Can't compile .cu file when including opencv.hpp
Using OpenCV's stitching module, strange error when compositing images
compile error in opencv2/flann/lsh_table.h when compiling bgslibrary