From 5bb646c04fc91580bf55f88f3e8558e5a2060a2a Mon Sep 17 00:00:00 2001 From: yokra9 <53964890+yokra9@users.noreply.github.com> Date: Mon, 2 Aug 2021 09:48:43 +0000 Subject: [PATCH] OpenCV crate doesn't support for WASM target ( twistedfall/opencv-rust/issues/124 ) --- .devcontainer/Dockerfile | 7 -- Cargo.lock | 167 --------------------------------------- Cargo.toml | 1 - 3 files changed, 175 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a8b9a45..9d3c5b6 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -20,10 +20,3 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/l # cargo install RUN su vscode -c "umask 0002 && cargo install wasm-pack && cargo install cargo-edit" - -# Install OpenCV and dependency -RUN apt-get update && apt-get install -y clang libclang-dev build-essential cmake pkg-config libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev gfortran openexr libatlas-base-dev libtbb2 libtbb-dev libdc1394-22-dev && mkdir ~/opencv_build && cd ~/opencv_build && git clone https://github.com/opencv/opencv.git && git clone https://github.com/opencv/opencv_contrib.git && cd ~/opencv_build/opencv && mkdir build && cd build && cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_GENERATE_PKGCONFIG=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules -D BUILD_EXAMPLES=ON .. && make -j2 && make install && apt-get clean -y && rm -rf /var/lib/apt/lists/* - -ENV OPENCV_INCLUDE_PATHS=/usr/local/include/opencv4/ -ENV OPENCV_LINK_LIBS=/usr/local/lib,opencv_gapi,opencv_stitching,opencv_aruco,opencv_barcode,opencv_bgsegm,opencv_bioinspired,opencv_ccalib,opencv_dnn_objdetect,opencv_dnn_superres,opencv_dpm,opencv_face,opencv_freetype,opencv_fuzzy,opencv_hfs,opencv_img_hash,opencv_intensity_transform,opencv_line_descriptor,opencv_mcc,opencv_quality,opencv_rapid,opencv_reg,opencv_rgbd,opencv_saliency,opencv_stereo,opencv_structured_light,opencv_phase_unwrapping,opencv_superres,opencv_optflow,opencv_surface_matching,opencv_tracking,opencv_highgui,opencv_datasets,opencv_text,opencv_plot,opencv_videostab,opencv_videoio,opencv_wechat_qrcode,opencv_xfeatures2d,opencv_shape,opencv_ml,opencv_ximgproc,opencv_video,opencv_dnn,opencv_xobjdetect,opencv_objdetect,opencv_calib3d,opencv_imgcodecs,opencv_features2d,opencv_flann,opencv_xphoto,opencv_photo,opencv_imgproc,opencv_core -ENV OPENCV_LINK_PATHS=/root/opencv_build/opencv/build/lib/ \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 9e08f1e..70727ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,15 +14,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" -[[package]] -name = "aho-corasick" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" -dependencies = [ - "memchr", -] - [[package]] name = "autocfg" version = "1.0.1" @@ -53,15 +44,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "cc" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" -dependencies = [ - "jobserver", -] - [[package]] name = "cfg-if" version = "0.1.10" @@ -74,26 +56,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "clang" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34c6913be3a1c94f52fb975cdec7ef5a7b69de10a55de66dcbc30d7046b85fa1" -dependencies = [ - "clang-sys", - "libc", -] - -[[package]] -name = "clang-sys" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c" -dependencies = [ - "glob", - "libc", -] - [[package]] name = "color_quant" version = "1.1.0" @@ -129,12 +91,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "dunce" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541" - [[package]] name = "gif" version = "0.11.2" @@ -145,12 +101,6 @@ dependencies = [ "weezl", ] -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - [[package]] name = "image" version = "0.23.14" @@ -169,15 +119,6 @@ dependencies = [ "tiff", ] -[[package]] -name = "jobserver" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" -dependencies = [ - "libc", -] - [[package]] name = "jpeg-decoder" version = "0.1.22" @@ -199,12 +140,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "libc" -version = "0.2.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" - [[package]] name = "log" version = "0.4.14" @@ -214,18 +149,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - -[[package]] -name = "memchr" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" - [[package]] name = "miniz_oxide" version = "0.3.7" @@ -286,60 +209,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" - -[[package]] -name = "opencv" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f88ec1678ecb26e63a56088b88c085055552bf6422fad2ff9a3c32444509cb8" -dependencies = [ - "cc", - "clang", - "dunce", - "glob", - "jobserver", - "libc", - "num-traits", - "once_cell", - "opencv-binding-generator", - "pkg-config", - "semver", - "shlex", - "vcpkg", -] - -[[package]] -name = "opencv-binding-generator" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b019fed1b525f2070a41ee08d1c24141e2d0dae02b2268082d0962e0f21d054b" -dependencies = [ - "clang", - "clang-sys", - "dunce", - "maplit", - "once_cell", - "percent-encoding", - "regex", -] - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pkg-config" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" - [[package]] name = "png" version = "0.16.8" @@ -370,35 +239,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "regex" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" - -[[package]] -name = "semver" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f3aac57ee7f3272d8395c6e4f502f434f0e289fcd62876f70daa008c20dcabe" - -[[package]] -name = "shlex" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a568c8f2cd051a4d283bd6eb0343ac214c1b0f1ac19f93e1175b2dee38c73d" - [[package]] name = "syn" version = "1.0.73" @@ -427,12 +267,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "wasm-bindgen" version = "0.2.74" @@ -494,7 +328,6 @@ dependencies = [ "console_error_panic_hook", "image", "js-sys", - "opencv", "wasm-bindgen", ] diff --git a/Cargo.toml b/Cargo.toml index b75646a..12e4323 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,4 +26,3 @@ image = { version = "0.23.14", default-features = false, features = [ "bmp", ] } js-sys = "0.3.51" -opencv = "0.53"