title: How can Wikitude be used in a project which also uses OpenCV?
body: <p>We can't get Wikitude working in a Xamarin crossplatform project (Android and iOS), which also uses OpenCV.</p>
  
  <h3>The Setup</h3>
  
  <p>Xamarin crossplatform project using MvvmCross with the following setup:</p>
  
  <ul>
  <li>Core-project, PCL providing view models, business logic and platform-agnostic logic in general.</li>
  <li>OpenCV.Droid, bindings project providing OpenCV to the Android part.
  
  <ul>
  <li>Android Library (AAR), created from the official OpenCV SDK for Android.</li>
  </ul></li>
  <li>OpenCV.iOS, bindings project providing OpenCV to the iOS part using P/Invoke.
  
  <ul>
  <li>Own static library project.</li>
  <li>Includes the static library from the official OpenCV SDK for iOS, which is just an Apple Framework (combining the static library and headers).</li>
  <li>Exposes OpenCV functionality via own API to minimize the amount of marshaling code.</li>
  </ul></li>
  <li>UI.Droid, Android platform project providing views and platform specific logic.</li>
  <li>UI.iOS, iOS platform project providing views and platform specific logic.</li>
  </ul>
  
  <p>Our ARchitectWorld uses Object Tracking and could successfully be tested in the Wikitude examples contained in the Xamarin Component for both Android and iOS.</p>
  
  <h3>The Problem</h3>
  
  <p>When starting the ARchitectWorld in our iOS project, the world is loaded and we receive the <code>onLoaded</code>-callback when creating the <code>TargetCollectionResource</code>, as well as the <code>onTargetsLoaded</code>-callback when creating the <code>ObjectTracker</code>. So far, the behavior is the same in Wikitude's sample project, as well as our project.</p>
  
  <p><em>The problem</em> 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.</p>
  
  <h3>The Investigation</h3>
  
  <p>When that problem occurred, we streamlined the logic in the ViewController which handles the ARchitectWorld, to rule out problems in our code there.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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:</p>
  
  <ul>
  <li><a href="https://support.wikitude.com/support/discussions/topics/5000078392" rel="noreferrer">Crash when work with OpenCV</a></li>
  <li><a href="https://support.wikitude.com/support/discussions/topics/5000082176" rel="noreferrer">Wikitude iOS JavaScript Crash on detection</a></li>
  </ul>
  
  <p>So then we found out, Wikitude and OpenCV both include partly the same third party code.</p>
  
  <h3>The questions</h3>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <ul>
  <li>Can, and if, how can this be achieved in a Xamarin project like the one I described?</li>
  <li>Does it require a certain version of OpenCV? (We are currently using v3.3.1.)</li>
  </ul>
  
  <p>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.</p>