Start a new topic

Why does getTargetPositionInCameraFrame() return null always?

Why does getTargetPositionInCameraFrame() return null always?

Hi Sergey,

are you using the latest version? (1.1.0)

Best regards,

Yes, 1.1.0 .


I try to play with and learn Android Native SDK. I have done a simple app for simple recognition based on sample. But I use internal renderer instead. I try to get recognized target position in OnTracking handler but getTargetPositionInCameraFrame() returns null always. Why? The target's name is right. How to get recognized target position then?

Hi again,

I just checked the code, the target position in camera frame will only be provided to Plugins right now, where we use the same Java class. Sorry about the confusion. I will take note of this, it shouldn't be a big problem to provide it the "onTracking" callback too. 

The idea around the target position was to give you the option to run your own CV algorithms in the area we recognized a target. For this we recommend to define a plugin.

You can use the matrices provided to draw something on top of your target.

Best regards,

The problem is that I need position to do other than drawing staff. I don't need to draw on the camera frame or to draw anything at all. Obvious use case are see through glasses or screens. Since camera field of view and see through display field of view are different augmentation on the camera frame doesn?t applicable. There are use cases not related to visual augmentation too. If you update SDK to provide position info then SDK will be applicable for mentioned use cases as well. By the way can position info be calculated from matrices? I guess so. Could you please explain how or refer where to read about this? 

Unfortunately it is not possible to calculate the target position with the matrices alone.

I already talked to our Chief Architect about this issue, and is very likely we will include the fix with the next Native SDK release, which will happen soon.

What you can do for now is define a Java plugin. (extend com.wikitude.common.plugins.Plugin) The RecognizedTarget instances you get in the update method contain the information you need.

Best regards,

I am using version 1.2.0 (dated December 1st 2015) and it also gives me back null. Can you tell me when it will be available?


Kind regards,

Hi Eric,
We sheduled an investigation task for the getTaretPositionInCameraFrame method. We did update the implementation in the last release but users reportet that the position was not correct for them.

Please follow our newsletter for more information about upcoming releases.

Best regards

Login or Signup to post a comment