NEW SDK spObject->get_Rank(&lRank);

Post Reply
avelazquez
Posts: 19
Joined: Mon Jun 07, 2010 7:40 am

NEW SDK spObject->get_Rank(&lRank);

Post by avelazquez »

Hello,

I am in the process of porting my application from the old SDK to the new SDK which by the way seems very user friendly, I am however looking for a function equivalent to:

long lRank;
spObject->get_Rank(&lRank); //get object's rank

from the old SDK, I will like to track the object with the highest rank.

Thanks!
VincentG
Posts: 7728
Joined: Mon Jul 17, 2006 5:00 am
Location: Corvallis, Oregon

Re: NEW SDK spObject->get_Rank(&lRank);

Post by VincentG »

There is no equivalent, however a better result is easily achieved.

I would suggest using an object's roundness and size as metrics for 'rank'.

For example use the object with the highest Roundness() that is at least a size of 10.
mikeincinci
Posts: 22
Joined: Tue Aug 14, 2007 7:26 am

Re: NEW SDK spObject->get_Rank(&lRank);

Post by mikeincinci »

What about the equivalent of "NP_OPTION_OBJECT_CAP="?
Are there preferred methods in new SDK for tracking a single dot?

If more than one objects are being tracked, is it safe to assume the first one will be the "higher ranked"?
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: NEW SDK spObject->get_Rank(&lRank);

Post by beckdo »

The SDK has a hard limit at 512 objects. There was a good reason to have that option in the previous SDK to improve performance by limiting the max to less objects but is not necessary in the new SDK.

Regarding ranking objects, the new SDK does not provide a rank or any specific order for objects. That said, it does provide more comprehensive information regarding objects to help users rank objects.

A good example is the Roundness() measurement. For any object you can call object->Roundness() to get a measure of how 'round' the object is. This utilizes a very high performance circle fitting algorithm that will give you a measure of roundness. In Precision Mode, this measurement is exceptionally accurate.

Since we tend to want to track round objects, a good measurement of object rank might be the highest object->Roundness() that is also object->Area() greater than 10 or 20 for example.

The concept of 'rank' is highly dependent on the application. We decided to provide all the high performance telemetry to enable users to fashion any 'rank' metric. Additionally, these calculations can be performed 'late' within the SDK meaning these metrics aren't even calculated unless the application needs them which results in higher performance.
mikeincinci
Posts: 22
Joined: Tue Aug 14, 2007 7:26 am

Re: NEW SDK spObject->get_Rank(&lRank);

Post by mikeincinci »

So I need to read ALL tracked objects (in case there exists more than one), and primary sort by roundness, secondary sort by Area?

Does this mean that there are 512 objects to be read every time, even if there is only one bright/round object to track?

Or will there only be as many objects in the frame to read as there are objects available to track?

Thanks,
mikeincinci
Posts: 22
Joined: Tue Aug 14, 2007 7:26 am

Re: NEW SDK spObject->get_Rank(&lRank);

Post by mikeincinci »

Anyone have a quick answer?
Birch
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon

Re: NEW SDK spObject->get_Rank(&lRank);

Post by Birch »

Its only necessary to iterate through the number of detected objects, not the potential 512 maximum. You can find out the number of detected objects using frame->ObjectCount(), for example here is some code from one of the sample applications included in the SDK :

Code: Select all

            for(int i=0; i<frame->ObjectCount(); i++)
            {
                cObject *obj = frame->Object(i);
Its also not necessary to sort unless you want to rank them.

We encourage you to review the SDK documentation and sample code to see how the SDK should be used.
mikeincinci
Posts: 22
Joined: Tue Aug 14, 2007 7:26 am

Re: NEW SDK spObject->get_Rank(&lRank);

Post by mikeincinci »

Thanks! I called myself looking through all the examples, but I somehow missed that one.
Post Reply