Camera control in Point Cloud

Post Reply
txemi
Posts: 7
Joined: Fri Jun 29, 2007 11:46 am

Camera control in Point Cloud

Post by txemi »

Hi.

It is possible to control the minimum size of the items detected by the cameras in PointCloud using the API of the OptiTrack.

Can I use a code like this in order to control the size of the items, for example?

Code: Select all

CoInitialize(NULL);

CComPtr<INPPointCloud>       pointCloud;
CComPtr<INPCameraCollection> spCollection;
LONG lNumCamerasDetected = 0;

if (spCollection.CoCreateInstance(CLSID_NPCameraCollection) == S_OK)
{
    if (spCollection->Enum() == S_OK) 
        spCollection->get_Count(&lNumCamerasDetected);
}

CComPtr<INPCamera> ComPtrCamera;
for (long iCamera = 0; iCamera < lNumCamerasDetected; iCamera++)
{
    if (m_ComPtrCamCollection->Item(iCamera, &ComPtrCamera) == S_OK)
    {
        ComPtrCamera->Open();

        ComPtrCamera->SetOption(NP_OPTION_THRESHOLD, (CComVariant) 12);
        ComPtrCamera->SetOption(NP_OPTION_THRESHOLD, (CComVariant) 150);
        ComPtrCamera->SetOption(NP_OPTION_OBJECT_MASS_MIN, (CComVariant) 10.0);

        ComPtrCamera->Close();
        ComPtrCamera.Release();
    }
}

pointCloud.CoCreateInstance(__uuidof(NPPointCloud));

HRESULT result = pointCloud->LoadProfile(Filename);

if(result==S_OK)
{
    pointCloud->Start();
    .....
    
    ....

    pointCloud->Stop();
}

spCollection.Release();
pointCloud.Release();
CoUninitialize();

Thanks.
leith
Posts: 194
Joined: Tue Jan 02, 2007 2:17 pm

Re: Camera control in Point Cloud

Post by leith »

That's a really good question. I've been meaning to ask in general, can you use the optritrak sdk along with the pointcloud sdk in the same application, to do this kind of thing? Or, once you're in the pointcloud sdk, is the optitrack sdk off limits?
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Camera control in Point Cloud

Post by beckdo »

Currently, you don't want to access the cameras through Optitrack once you've initialized and are using the Point Cloud SDK. We're working to either make concurrent use of both libraries possible or at the very minimum provide all the functionality users would want directly through the Point Cloud SDK. The upcoming release will be an improvement on this issue.
Post Reply