Fast option switching

Post Reply
Manium
Posts: 8
Joined: Mon Oct 01, 2007 7:46 am

Fast option switching

Post by Manium » Wed Sep 16, 2009 8:48 am

Hello,

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);	
			}
	}
}
and the code for the acquisiton, based on the non-com example:

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);
(...)
 }
}
Is there any better way to do this and gain some speed? Since there is a lag each time i switch to a different mode. Maybe is there any instruction to force a new acquisition? I have tried to simply call the function (second code here) but it simply ignores the call.

Thank you!

Post Reply