Page 1 of 1

Camera control in Point Cloud

Posted: Wed Jul 25, 2007 7:59 am
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.

Re: Camera control in Point Cloud

Posted: Sun Jul 29, 2007 10:23 am
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?

Re: Camera control in Point Cloud

Posted: Mon Jul 30, 2007 9:43 am
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.