webarkit / webarkit-testing

Testing a new version of WebARKit
https://www.webarkit.org/examples/webarkit-testing/
GNU General Public License v3.0
2 stars 0 forks source link

Improving webarkit Trackers #14

Closed kalwalt closed 1 year ago

kalwalt commented 1 year ago

Still improving WebARKitTRackers code before create a branch inside the official WebARKitLib repository.

List of added features:

kalwalt commented 1 year ago

Trying to solve issue #11 this is the error in the console:

webarkit_ES6_wasm.js:1418 Uncaught 341866552 - Exception catching is disabled, this exception cannot be caught. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.
___cxa_throw @ webarkit_ES6_wasm.js:1418
$cv::error(cv::Exception const&) @ 00f16666:0x10d34b
$cv::error(int, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>> const&, char const*, char const*, int) @ 00f16666:0x10cf7d
$cv::(anonymous namespace)::SparsePyrLKOpticalFlowImpl::calc(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputOutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&) @ 00f16666:0x20db2c
$cv::calcOpticalFlowPyrLK(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputOutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::Size_<int>, int, cv::TermCriteria, int, double) @ 00f16666:0x20d2c0
$WebARKitAkazeTracker::track(cv::Mat&) @ 00f16666:0x10a5b
$WebARKitAkazeTracker::processFrame(cv::Mat&) @ 00f16666:0xc187
$WebARKitAkazeTracker::processFrameData(unsigned char*, unsigned long, unsigned long, ColorSpace) @ 00f16666:0xbab5
$WebARKit::processFrame(emscripten::val, ColorSpace) @ 00f16666:0x1ef92
$emscripten::internal::MethodInvoker<void (WebARKit::*)(emscripten::val, ColorSpace), void, WebARKit*, emscripten::val, ColorSpace>::invoke(void (WebARKit::* const&)(emscripten::val, ColorSpace), WebARKit*, emscripten::_EM_VAL*, ColorSpace) @ 00f16666:0x2062f
WebARKit$processFrame @ VM24:10
processFrame @ WebARKitController.js:105
process_raw @ WebARKitController.js:80
processFrame @ worker.js:53
self.onmessage @ worker.js:16

i need to understand what is wrong in the calcOpticalFlowPyrLK.

kalwalt commented 1 year ago

Note that this exeception occur only for the Akaze tracker, the Orb is not affected... at least doesn't happens to me.

p.s. No this happens also for the orb example.

kalwalt commented 1 year ago

this not happens with webarkit-OCVT with PlanarOrbTracker, but there i use emsdk 3.1.7 not 3.1.26 instead OpenCV is the same 4.5.0. Maybe a bug related to Emscripten?

kalwalt commented 1 year ago

Ok now i tested with emsdk 3.1.7 and the issue #11 still persist, so the Emscripten version is not causing the issue.

kalwalt commented 1 year ago

Maybe because i did a mismatch in the code, (before i make changes in the main branch and after i merged in this) now wihile rebuilding the whole project it seems that the unchaught exception is disappeared. There are a lot to be improved, i.e. in the akaze example it can track but if you remove the trackable image the image displayed stay in place blinking, maybe something not correct in processFrameDatawith the shared_ptr?

kalwalt commented 1 year ago

latest commit try to improve the code and to completely to solve issue #11. It a bit better but not full solved. AT least with the orb example is more difficult to catch the Uncaught exception.

kalwalt commented 1 year ago

Now OpenCV is a as a git submodule (webarkit/opencv) with branch webarkit-4.7.0-exp. It's a modified version with applied the patch as said in this opencv issue comment. We are testing OpenCV 4.7.0 and emsdk 3.1.26.