We can't get Wikitude working in a Xamarin crossplatform project (Android and iOS), which also uses OpenCV.
Xamarin crossplatform project using MvvmCross with the following setup:
Our ARchitectWorld uses Object Tracking and could successfully be tested in the Wikitude examples contained in the Xamarin Component for both Android and iOS.
When starting the ARchitectWorld in our iOS project, the world is loaded and we receive the onLoaded
-callback when creating the TargetCollectionResource
, as well as the onTargetsLoaded
-callback when creating the ObjectTracker
. So far, the behavior is the same in Wikitude's sample project, as well as our project.
The problem is, that the same object using the same WTO-file is not being recognized in our project, while it's working very well in the sample project.
When that problem occurred, we streamlined the logic in the ViewController which handles the ARchitectWorld, to rule out problems in our code there.
We then investigated our project by adding the ARchitectWorld to different commits in our repo's history, which we deemed critical changes and found commits, were object tracking was working.
To find the critical change, we used git-bisect and identified the commit which introduced the problem. With that commit the static library of our OpenCV bindings project was updated, because it was missing the device-architectures - it only had the simulator archs, basically x86_64.
After that, we assumed, Wikitude might use OpenCV internally and we could get symbol collisions, even though the linker didn't complain about duplicate symbols. Though, Wikitude does not use OpenCV but a search for the combined use of Wikitude and OpenCV brought up some results without solutions:
So then we found out, Wikitude and OpenCV both include partly the same third party code.
In the linked posts, the Wikitude support answered quite openly, suggesting an internal discussion and coming back to the OPs. Though no further answers are in the thread, suggesting either there is none or the information has been exchanged through another channel.
In other posts, we saw the suggestion of using OpenCV with Wikitude, by preparing visual data and feed it to an input plugin. This suggests, that OpenCV and Wikitude can be used together.
Maybe the community also achieved this and I'm very looking forward to answers about that. We also contacted Wikitude support and will feedback information here, if we receive any, that is useful to answer the question.
AR image recognition typically uses an AR app where learners scan real-world 2D images and overlay 2D video, text, pictures, or 3D objects on it. Image recognition is a marker-based AR technology. Think of a marker as an anchor that connects virtual content with the real-world.
Architecture of the Wikitude SDK It includes three major parts in its own: SLAM Engine, Image Recognition Engine and the Object Recognition engine.
Google Maps One of the most popular mapping apps features an AR mode that helps you navigate to the destination by adding virtual signs and directional arrows over the live view on phone in order to point the way.
Marker-based AR This type of AR, also known as recognition-based AR or image recognition, relies on identification of markers/user-defined images to function.
We finally have a working application using Wikitude and OpenCV. Though we were not able to clearly identify the root cause. The steps that led to a working solution are as follows:
--without
parameter for the build script build_framework.py
to reduce the amount of possible conflicts. This was wrong anyways, as the binaries get stripped during native linking and no errors appeared.
--dyanmic
, still faced the error during native linking when compiling the Xamarin project.)17233c687e2d51010dab2587f2532a460ccdb4b6
, something beyond v3.4.0) turns out to work and not break Wikitude: https://github.com/opencv/opencv
TL;DR
Building OpenCV from its source on GitHub, at least commit 17233c687e2d51010dab2587f2532a460ccdb4b6
turned out to not break Wikitude.
We will have a look at the downloadable iOS framework of the next release of OpenCV, to see, whether that works and return to using that, instead of building OpenCV ourselves.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With