Continuous Transfer

INFINICAM UC-1 SDK Retrieving and Decoding Images

Start continuous transfer to repeatedly retrieve images from the device in the SDK. The SDK includes a ring buffer for storing images. Retrieved images are stored in the buffer in sequence.

As retrieving an image in the SDK will call a preset function (referred to as the callback function below), run a save process within this function.

The buffer will be locked and cannot be overwritten while the callback function is running. When the callback function processing time is too long, image retrieval in the SDK catches up and image retrieval is put in standby. In this case, the chance of frame dropping increases. To avoid this, set the ring buffer to the highest possible value.

※A single buffer will use about 0.4 MB of memory.

Increasing the number of ring buffers does not guarantee that frame dropping will not occur. Frame dropping may occur due to an interruption of another software on the OS.

Configuring Ring buffer count

Use the following function to set the ring buffer count.

result = PUC_SetRingBufferCount(hDevice, 1024);
if (PUC_CHK_FAILED(result))
{
return;
}

※The maximum ring buffer count that can be set is defined in PUC_MAX_RING_BUF_COUNT.

Starting continuous transfer

FILE* fp;

_tfopen_s(&fp, _T(“test.dat”), _T(“wb”));

result = PUC_BeginXferData(hDevice, RecieveProc, fp);
if (PUC_CHK_FAILED(result))

return;
}

For the “PUC_BeginXferData” argument, specify a pointer to the callback function called when retrieving images, and arguments given to the callback function. In the example above, the file pointer already opened is passed.

void RecieveProc(PPUC_XFER_DATA_INFO pXferData, void* arg)
{
FILE* fp = (FILE*)arg;
fwrite(pXferData->pData, pXferData->nDataSize, 1, fp);
}}

Images are written to the file with the callback function. Reduce processing as much as possible. The frame dropping might occur when the callback function takes time.

Finishing continuous transfer

result = PUC_EndXferData(hDevice);
if (PUC_CHK_FAILED(result))
{
return;
}

> INFINICAM Product page

ハイスピードカメラの選定・販売・レンタルから
撮影・解析までお任せください

お問い合わせは
こちらから

専門知識を持った担当者が
お客様の課題や要件をお伺いします

無償デモ撮影・解析
の申し込み

ハイスピードカメラの動作や
必要性を事前に検証できます

製品価格入り資料を
ダウンロード

製品のカタログや活用事例集を
無料でダウンロードできます

電話でお問い合わせ

平日9:00~18:00

03-3518-6271