Processing time is longer only during the initial imaging

General Information

  • Product: C57-6-M
  • Serial Number: 244888
  • Ensenso SDK Version: 4.0.1502
  • Operating System: Windows 10 64bit
  • Data Attachments
    • Profiler log

Problem / Question

We are using custom software with an external trigger to image workpieces arriving at 8-second intervals.
Basically, imaging works without problems,
but the first imaging process after connecting the camera takes nearly 3 seconds.
Subsequent imaging processes take about 1.7 seconds.

The above times represent the time taken for the following processes:

  1. Capture
  2. Pointmap acquisition
  3. Feature point extraction
  4. Saving result data
  5. Saving parameters

Processes 1, 2, and 5 are performed via nxlib.

We have collected logs.
Could you please check if there is a difference in processing time via nxlib
between the first image and subsequent images?

We have attached two logs collected under the following conditions:

  1. Log for the first and second images
    (tmp_NxTreeEdit20260615(first,second).enslog)
  2. Log for the nth and (n+1)th images in subsequent imaging cycles
    (tmp_NxTreeEdit20260615(n,n+1).enslog)

Thank you for your assistance.

Best regards,
K.N,

tmp_NxTreeEdit20260615(first,second).enslog (166.6 KB)

tmp_NxTreeEdit20260615(n,n+1).enslog (648.8 KB)

settings.json (247 Bytes)

Hello, K.N,

Thank you for your detailed post, but unfortunately the logs you attached contain no actual data.

Firstly, the first long imaging cycle (~3s) is a known and expected behavior. The delay occurs because several internal resources are initialized lazily upon the first execution of the capture and processing commands:

  1. Rectification Lookup Table: The SDK calculates an internal lookup table to speed up image rectification. This is computed on the very first execution of ComputeDisparityMap (or RectifyImages).
  2. Algorithm Memory Buffers: The stereo matching algorithm (PatchMatch) allocates significant memory buffers for descriptors and intermediate calculations. For a high-resolution camera like the C57, this can involve hundreds of megabytes of RAM or VRAM.
  3. CUDA/OpenGL Context Initialization: If GPU acceleration is enabled, the first call triggers the creation of the CUDA context and the compilation/caching of necessary kernels. Similarly, if you are rendering the pointmap, the OpenGL context is initialized on the first run.

See, for example, discussion here Calculations for the first point cloud takes long time.

A common practice in external-triggered industrial workflows is to perform a “warm-up” capture immediately after connecting to the camera and initializing the SDK. You can trigger and compute the first frame, discard the result, and only then begin your actual 8-second production cycle. This ensures all heavy allocations happen before your first real workpiece arrives.

Secondly, a steady-state processing time of 1.7s for a C57 is somewhat a bit longer than expected. You can look through our guide Optimize Settings for Performance/Quality, but I would also happy to see real profiling data to make some recommendations. It would also helpful if you would share your PC/GPU specifications and your ComputeDisparityMap parameters, and we can look into performance tuning options.

Best wishes,
Gisha

HI Grisha

First, thanks a lot for your quick response!

I apologize for the delayed response.

Q1. When using an external trigger, is there a way to activate a warm-up trigger without physically turning on the sensor?

Since the sensor is installed in a high location, it is difficult to physically trigger it by activating the sensor before the workpiece arrives .

Also, I do not want to resort to simply sacrificing the first workpiece.)

Q2.When starting my custom software, I set the trigger mode to software mode and perform a “warm-up capture.”
Then, I change the trigger mode to the external trigger “FallingEdge.”
Is this method effective?
(Would this method allow for imaging from the first workpiece with a short processing time?)

Best regards,
K.N,

Hi

May I ask an additional question?

Regarding the phrase “after connecting to the camera and initializing the SDK” mentioned above, could you please explain the conditions under which a “warm-up capture” is required?

For example, is a “warm-up capture” necessary if the camera is disconnected and then reconnected?

Or, once the camera is powered on and connected, is a “warm-up capture” unnecessary for subsequent operations?

I apologize for the additional request, but could you please let me know?

Thank you in advance.

Best regards,
K.N,

Hi,

The correct approach in your case is to trigger a warm-up capture

  • The first time the SDK is initialized during your application life-cycle
  • If the camera is disconnected and reconnected

in your case a Software Trigger should work for the warm-up capture, then switch to the Hardware Trigger to be ready for the work piece.

Regards,
Miguel