Send3DImage
Top  Previous  Next

Description

Streams the specified 3D point cloud image array to the network.

[C++]
int
 Send3DImage(const char* frame, unsigned __int64 points, unsigned int channelIndex = 0);


Parameters
[C/C++]
 
[in] const char* frame  
Pointer to the beginning of the point cloud array.  
 
[in] unsigned int points  
The amount of 3D points in the array. Each point must be represented by three coordinate values (X, Y, Z).  
 
[in] unsigned int channelIndex  
Index of the associated stream channel. Possible values are 0 or 1.  
 


Return Values

S_OK  
Success  
E_FAIL  
Failure  
 

Example


This fragment of code repeatedly sends a 3D point cloud image array over the network.

   m_pCamera->SetImageSize(width, height);
   m_pCamera->SetMaxImageSize(width, height);
   m_pCamera->SetPixelFormat("Coord3D_ABC32f");
   m_pCamera->SetGevMode(CGevCamera::GEV_VERSION_MODE::GEV_2);
   m_pCamera->SetPayloadType(CGevCamera::PAYLOAD_TYPE::PAYLOAD_3DPOINTCLOUD);
 
 
if (m_pCamera->connect(m_interfaceList.GetCurSel())  
{  
   m_exitThread = false;  
   m_thread = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)videoGenThread, this, 0, NULL);  
}  
 
void CGigemuDlg::videoGenerator()   
{  
   int ret;
   while (!m_exitThread) 
   {
      ret=m_pCamera->LockFormat();
      ret=m_pCamera->Send3DImage(m_points3D.get(), m_total3DPoints);
      Sleep(20);
   }  
}  


Remarks

This function is typically called in a cycle to stream a series of 3D point cloud frames from the virtual camera to the network. The camera must be in the connected state and the acquisition must have been started by a client application.

Note that for the correct operation of this function GevMode must be set to GEV_2, PixelFormat must be set to Coord3D_ABC16 (16-bit integer coordinates) or Coord3D_ABC32f (32-bit floating point coordinates) and the type of data in the array must correspond to the selected pixel format.

If the Send3DImage cycle is called before the acquisition is started by the client, the LockFormat method must be called prior to calling Send3DImage in order to lock the execution of the thread until the AcquisitionStart command is issued by the client. Alternatively you can use the Write Callback to intercept AcquisitionStart and AcquisitionStop commands from the client application and to synchronize them with the beginning and end of the image transfer cycle.

Each image streamed with this function will contain a timestamp per GigE Vision standard indicating the exact time at which the image was generated. Depending on the Timer Mode, the timestamp will be reported either in the astronomical time or time elapsed from the start of the virtual camera application.

Note the channelIndex parameter should be used only if your virtual camera must support multiple streaming channels. For a regular GigE Vision transfer this parameter should remain in its default zero value.