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.