Log in or register to post comments

Frame Marker Creation Fails

October 18, 2013 - 7:24am #1

Hi!

I'm trying to create frame markers using a good old for loop, but it seems that the the frame marker creation fails predictably on markers 06 and 07 some others too, but I have scaled down my requirement to only need 25 markers for testing. As a side note, if I increase the range to 512 markers in total the results are similar.

Is there some way to see *why* it fails? Or is there something wrong with the code?

I don't think there is anything clever about my marker creation: I copied it from the Frame Marker sample and adapted it to a loop:

for( int a = 0; a < 25; a = a + 1 )
{
if (!markerTracker->createFrameMarker(a, "Marker" + a, QCAR::Vec2F(50,50)))
   {
       LOG("Failed to create frame marker");
   }
   else
   {
       LOG("Created frame marker");
   }
}
 
When it runs, I get "Failed..." on marker 06 and 07 consitently. The following code i I've even built an "auto-retry" feature, but the results are the same on successive attemps..
 
Any assistance with this wouyld be greatly appreciated!
 
 
 
 

Frame Marker Creation Fails

October 18, 2013 - 7:58am #2

Ok, I solved it and thought I'd share in case anybody else finds this. Thebiggest trick is to stop the marker tracker before creating the markers and start it after you're done... I also slightly modified the loop, based on this post:

https://developer.vuforia.com/forum/qcar-api/markers-4-not-recognized-vuforia

 

    markerTracker->stop();
	for (int i = 0; i < 512; ++i)
	{
		char markerName[200];
		sprintf (markerName, "Marker%d", i);

		// Create frame markers:
		if (!markerTracker->createFrameMarker(i, markerName, QCAR::Vec2F(50,50)))
		{
			LOG("Failed to create frame markers");
			return 0;
		}
		else
		{
			LOG("Created frame markers");
		}
	}
    markerTracker->start();

 

 

Log in or register to post comments