Skip to content

Small upgrades #27

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

Draft
wants to merge 9 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,712 changes: 5,049 additions & 7,663 deletions build/webarkit_ES6_wasm.js

Large diffs are not rendered by default.

12,712 changes: 5,049 additions & 7,663 deletions build/webarkit_ES6_wasm.simd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build_cv_w_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if [ $BUILD_SIMD ] ; then
SIMD=" --simd "
fi

docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) -e "EMSCRIPTEN=/emsdk/upstream/emscripten" emscripten/emsdk:3.1.26 emcmake python3 ./opencv/platforms/js/build_js.py opencv_js --config="./opencv.webarkit_config.py" $SIMD --build_wasm --cmake_option="-DBUILD_opencv_dnn=OFF" --cmake_option="-DBUILD_opencv_objdetect=OFF" --cmake_option="-DBUILD_opencv_photo=OFF" --cmake_option="-DBUILD_opencv_imgcodecs=ON" --cmake_option="-DBUILD_opencv_xfeatures2d=ON" --cmake_option="-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/" --build_flags="-Oz -s EXPORT_ES6=1 -s USE_ES6_IMPORT_META=0"
docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) -e "EMSCRIPTEN=/emsdk/upstream/emscripten" emscripten/emsdk:3.1.26 emcmake python3 ./opencv/platforms/js/build_js.py opencv_js --config="./opencv.webarkit_config.py" $SIMD --build_wasm --cmake_option="-DBUILD_opencv_dnn=OFF" --cmake_option="-DBUILD_opencv_objdetect=OFF" --cmake_option="-DBUILD_opencv_photo=OFF" --cmake_option="-DBUILD_opencv_imgcodecs=ON" --cmake_option="-DBUILD_opencv_xfeatures2d=ON" --cmake_option="-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/" --build_flags=" -fwasm-exceptions -mbulk-memory -mnontrapping-fptoint -sWASM_BIGINT -sSUPPORT_LONGJMP=wasm "

# copy the output to the build folder
#cp -r opencv_js/bin/opencv_js.js build
2 changes: 1 addition & 1 deletion dist/GrayScale.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/SpeedyVisionSinkImageData.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/WebARKit.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/WebARKit.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
9 changes: 9 additions & 0 deletions emscripten/WebARKitJS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ emscripten::val WebARKit::getPoseMatrix2() {
return pose;
}

emscripten::val WebARKit::getTransformationMatrix() {
std::array<double, 16> transMatrix = manager.getTransformationMatrix();
emscripten::val tM = emscripten::val::array();
for(auto t:transMatrix) {
tM.call<void>("push", t);
}
return tM;
}

emscripten::val WebARKit::getGLViewMatrix() {
cv::Mat glViewMatrix = manager.getGLViewMatrix();
emscripten::val glView = emscripten::val::array();
Expand Down
1 change: 1 addition & 0 deletions emscripten/WebARKitJS.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class WebARKit {
emscripten::val getHomography();
emscripten::val getPoseMatrix();
emscripten::val getPoseMatrix2();
emscripten::val getTransformationMatrix();
emscripten::val getGLViewMatrix();
emscripten::val getCameraProjectionMatrix();
emscripten::val getCorners();
Expand Down
1 change: 1 addition & 0 deletions emscripten/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ EMSCRIPTEN_BINDINGS(constant_bindings) {
.function("getPoseMatrix", &WebARKit::getPoseMatrix)
.function("getPoseMatrix2", &WebARKit::getPoseMatrix2)
.function("getGLViewMatrix", &WebARKit::getGLViewMatrix)
.function("getTransformationMatrix", &WebARKit::getTransformationMatrix)
.function("getCameraProjectionMatrix", &WebARKit::getCameraProjectionMatrix)
.function("getCorners", &WebARKit::getCorners)
.function("isValid", &WebARKit::isValid);
Expand Down
Loading