Log in or register to post comments

Bring multiple targets into a common place

October 22, 2017 - 3:02am #1

I've followed the instruction provided in this post https://developer.vuforia.com/forum/faq/android-how-can-i-bring-multiple-targets-common-space to enable multiple targets detection in common space. 

I have replaced all the "QCAR" to "Vuforia" in ImageTargets.cpp. However, I've encountered the following errors during compilation.

 

Error:(342, 40) error: no member named 'getNumActiveTrackables' in 'Vuforia::State'; did you mean 'getNumTrackables'?

Error:(345, 57) error: no member named 'getActiveTrackable' in 'Vuforia::State'; did you mean 'getTrackable'?

Error:(347, 60) error: no member named 'getPose' in 'Vuforia::Trackable'

Error:(379, 19) error: no member named 'getNumActiveTrackables' in 'Vuforia::State'; did you mean 'getNumTrackables'?

Error:(400, 42) error: use of undeclared identifier 'projectionMatrix'

Error:(427, 36) error: use of undeclared identifier 'normalHandle'

 

Are those methods deprecated from vuforia-sdk-android-6-5-19 ? 

 

I'll be glad if anyone will help me out in this.

Thank you.

Bring multiple targets into a common place

October 22, 2017 - 4:17am #2

I have updated the Java_com_vuforia_samples_ImageTargets_ImageTargetsRenderer_renderFrame to the following:

............

.............

// Did we find any trackables this frame?

        for(int tIdx = 0; tIdx < state.getNumTrackableResults(); tIdx++)

        {

            // Get the trackable:

             const Vuforia::TrackableResult* result = state.getTrackableResult(tIdx);

             const Vuforia::Trackable& trackable = result->getTrackable();

                    Vuforia::Matrix44F modelViewMatrix =

                        Vuforia::Tool::convertPose2GLMatrix(result->getPose());

...................

..............

if (state.getNumTrackableResults() > 1)

        {

..................

..............

 

 

And added in Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_setProjectionMatrix method as the following: 

 

JNIEXPORT void JNICALL

Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_setProjectionMatrix(JNIEnv *, jobject)

{

    LOG("Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_setProjectionMatrix");

    // Cache the projection matrix:

    const Vuforia::CameraCalibration& cameraCalibration =

                                Vuforia::CameraDevice::getInstance().getCameraCalibration();

    projectionMatrix = Vuforia::Tool::getProjectionGL(cameraCalibration, 10.0f, 5000.0f);

}

 

 

Lastly, I've also added in two more variables on the top part of the file:



// The projection matrix used for rendering virtual objects:

Vuforia::Matrix44F projectionMatrix;

GLint normalHandle              = 0;

 

 

No more compilation error now and the ImageTargetsNative app did not crash. However, the camera view displays black screen. 

Can anyone help me with this? 

 

Thanks in advance

Log in or register to post comments