I would like to ask for some guidance on how to use StartInputFromImage method in Kudan plugin for Unity.
Let's say I want to use the image of a street (for example this: https://upload.wikimedia.org/wikipedia/commons/3/39/Downtown_Temple,_TX_at_Main_Street_IMG_2384.JPG) as a texture which will be processed by Kudan TrackingMethodMarkerless.
In KudanTracker class in Start() there is a following code: // Start the camera
#if UNITY_EDITOR
if (_trackerPlugin.StartInputFromCamera(_playModeWebcamID, DefaultCameraWidth, DefaultCameraHeight))
#else
if (_trackerPlugin.StartInputFromCamera(0, DefaultCameraWidth, DefaultCameraHeight))
#endif
I figured that I should just change the input method here, so I changed it like this:
#if UNITY_EDITOR
if (_trackerPlugin.StartInputFromImage(myImage))
#else
if (_trackerPlugin.StartInputFromImage(myImage))
#endif
BUT: when I run the app in Editor, the Unity crashes with an error. I suspect that it could be due to the TrackerWindows implementation of this method looking like this:
public override bool StartInputFromImage(Texture2D image)
{
// First stop existing input
bool wasTracking = _isTrackingRunning;
StopInput();
// Resume tracking
if (wasTracking)
{
StartTracking();
}
return true;
}
...I mean, this literally does not do anything with image.
Implementation of the same method in TrackerAndroid looked way more promising so I went with it because I am developing the Android app after all.
However here the code gets stuck in ArbiTrackGetPose() method.
the process looks like this:
1)in KudanTracker.Update() - _currentTrackingMethod.ProcessFrame() is called
2)in TrackingMethodMarkerless.ProcessFrame() - _kudanTracker.ArbiTrackGetPose(out position, out orientation) is called
3)in TrackerAndroid.ArbiTrackGetPose() - m_KudanAR_Instance.Call ("updateArbi", _floorHeight) is called but is not executed properly the following code is not compiled. And since I can't fully examine "updateArbi" function, I don't know what is wrong.
Should I use some different approach? Do you see some mistake in mine? Thanks for any suggestions!