Getting the number of markers in a vector

Post Reply
itzikgili
Posts: 3
Joined: Fri Dec 27, 2013 5:47 am

Getting the number of markers in a vector

Post by itzikgili »

I'm woking with the vector tracking sample project.

after the loop that iterates over the object found in the frame:

Code: Select all

 for(int i=0; i<frame->ObjectCount(); i++)
            {
                cObject *obj = frame->Object(i);
                float x = obj->X();
                float y = obj->Y();
                Core::Undistort2DPoint(lensDistortion,x,y);
                vec->PushMarkerData(x, y, obj->Area(), obj->Width(), obj->Height());
            }
when trying to get the number of markers pushed to the vector, I get 0! always.
int r= vec->MarkerCount();

r=0 always!

how come? Is there any filtering of bigger/smaller objects?
Note that if I use frame->ObjectCount() I get the number.
NaturalPoint-Dustin
Posts: 609
Joined: Tue Mar 19, 2013 5:03 pm

Re: Getting the number of markers in a vector

Post by NaturalPoint-Dustin »

Hello,

I will ask one of our software engineers to submit a response for you. You should have a reply shortly.

Regards,
Dustin
Technical Support Engineer
OptiTrack | TrackIR | SmartNav
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Getting the number of markers in a vector

Post by beckdo »

There are some filtering rules that are being applied but they are fairly loose. What's critical is that you have passed the appropriate settings structure selecting what clip you are tracking (vector clip or the track clip pro). The fact that it's returning zero means that it's not finding a solution. What are you tracking exactly, is it located at an appropriate distance, is there significant background noise? Maybe take a screenshot showing what the cameras sees and attach it so we can see.
Post Reply