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

Improving webarkit Trackers #14

Merged
merged 12 commits into from
Apr 25, 2023
Merged

Improving webarkit Trackers #14

merged 12 commits into from
Apr 25, 2023

Conversation

kalwalt
Copy link
Member

@kalwalt kalwalt commented Apr 21, 2023

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

List of added features:

@kalwalt
Copy link
Member Author

kalwalt commented Apr 21, 2023

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 kalwalt added enhancement New feature or request javascript Emscripten / C / C++ all about Emscripten labels Apr 21, 2023
@kalwalt
Copy link
Member Author

kalwalt commented Apr 21, 2023

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
Copy link
Member Author

kalwalt commented Apr 23, 2023

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
Copy link
Member Author

kalwalt commented Apr 23, 2023

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

- it seems that issue #11 is solved
@kalwalt
Copy link
Member Author

kalwalt commented Apr 23, 2023

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 processFrameData with the shared_ptr?

@kalwalt
Copy link
Member Author

kalwalt commented Apr 24, 2023

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.

- build with emsdk 3.1.26
@kalwalt
Copy link
Member Author

kalwalt commented Apr 24, 2023

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.

@kalwalt kalwalt merged commit 6531bd1 into main Apr 25, 2023
@kalwalt kalwalt deleted the improving-webarkitTrackers branch May 3, 2023 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Emscripten / C / C++ all about Emscripten enhancement New feature or request javascript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant