I have made application using PointCloud and 6 V100 cameras. At a given moment, i have to switch options of the cameras as fast as possible. I do not know if i use the good method since i mix Com and non-com code...
Here is my code:
Code: Select all
void CPointCloud::setMode(const int _mode){
	switch(_mode){
		case O3D_MODE_1:
			for(int index=0; index < m_cameraCount; index++){
				CComPtr<INPCamera>           camera;
				cameraCollection->Item(index, &camera);
				camera->SetOption(NP_OPTION_INTENSITY,   (CComVariant) 1);
				camera->SetOption(NP_OPTION_EXPOSURE,   (CComVariant) 100);	
				camera->SetOption(NP_OPTION_THRESHOLD,   (CComVariant) 90);	
			}
			break;
		case O3D_MODE_2:
			for(int index=0; index < m_cameraCount; index++){
				CComPtr<INPCamera>           camera;
				cameraCollection->Item(index, &camera);
				camera->SetOption(NP_OPTION_INTENSITY,   (CComVariant) 5);
				camera->SetOption(NP_OPTION_EXPOSURE,   (CComVariant) 30);	
				camera->SetOption(NP_OPTION_THRESHOLD,   (CComVariant) 50);	
			}
	}
}
Code: Select all
if (NP_GetLatestFrame() == NPRESULT_SUCCESS){
		for (int j = 0; j < NP_FrameMarkerCount(); ++j){
			x = NP_FrameMarkerX(j);
			y = NP_FrameMarkerY(j);
			z = NP_FrameMarkerZ(j);
(...)
 }
}
Thank you!