Skip to content

[BUG] ids peak support for uEye-only cameras issues #1545

@barentine

Description

@barentine

Describe the bug
As discussed elsewhere, U3 and up cameras only support IDS peak api, while the older uEye cameras can still operate through a shim. I'm finally getting around to trying a uEye camera with the IDS peak API, and have come across a couple of issues.

Certianly, the easiest way to get around this issue is just to revert back to using the pyuEye implementations for older cameras (SDK stuff is still included in the ids peak installation, just pip install pyueye and use PYME ueye.UEyeCamera), but in the hopes of one day maintaining just one I wanted to document what I've run into.

  1. 12 bit does not seem to be supported.
  2. You cannot set the framerate by changing the exposure time

12 bit does not seem to be supported.

Our 12 bit handling on these cameras could ~always use a little more clarity I think. It looks like we go with the route of packing 12 bit into padded 16bit. The IDS peak api comes with an IPL part of the package with some image format query / buffer allocation / conversion helper functions we might enjoy using at some point in the future. Meanwhile, if I try to run a 12 bit uEye camera (UI327xCP-M) with the 12 bit initialization, I get the lower half of each frame returned as zeros, and the top part of each frame duplicated. Obviously we're missing some pixels with this, since it thinks the size is correct.
image
If I try to use the IDS peak queries to ask for the pixel format, I get 'Custom' regardless of whether we are in 12 bit or 8 bit mode. Additionally, the 'payloadsize', height and width suggest they are both just 8 bit. Running in 8 bit mode works 'fine'

>>> buffer = scope.cam._data_stream.WaitForFinishedBuffer(100)
>>> buffer.PixelFormat()
17301505
>>> from ids_peak import ids_peak as peak
>>> peak.PixelFormatNamespaceEnumEntryToString(buffer.PixelFormat())
'Custom'

You cannot set the framerate by changing the exposure time

On startup, my camera is getting limited to 39.9 ms integration time, or 25 FPS. I can't set it to a higher integration time, and this is in fact enforced by the IDS peak DLL / camera. In order to adjust the integration time higher, I have to first set the AcquisitionFrameRate higher and then I can freely adjust the intregration time up to the max it should be for that framerate. On second look, this is the same as the uEye API, I just missed it when setting up the ids peak thing.

scope.cam._node_map.FindNode("AcquisitionFrameRate").Value()
>>> scope.cam._node_map.FindNode("AcquisitionFrameRate").Value()
0.999996000016
>>> scope.cam._node_map.FindNode("ExposureTime").Maximum()  # [us]
999932.622
>>> scope.cam._node_map.FindNode("AcquisitionFrameRate").SetValue(50)
>>> scope.cam._node_map.FindNode("ExposureTime").Maximum()  # [us]
19930.649
>>> scope.cam._node_map.FindNode("ExposureTime").SetValue(19000)  # [us]
>>> scope.cam._node_map.FindNode("AcquisitionFrameRate").Value()
49.99500049995
>>> scope.cam._node_map.FindNode("ExposureTime").SetValue(10000)  # [us]
>>> scope.cam._node_map.FindNode("AcquisitionFrameRate").Value()
49.99500049995

Workaround for this could be fairly straightforward, we just need to calculate the framerate from a given exposure time, set framerate first and then set the exposure time.

Platform (please complete the following information - or copy-paste from error dialog if shown):

  • OS: Win10
  • Python version: 3.7
  • numpy version: 1.19.2
  • IDS SDK peak version: 2.11.0.0-339
  • python ids_peak version: 1.8.0.0.1 pypi_0 pypi
  • python ids-peak-ipl version: 1.12.1.0.1 pypi_0 pypi

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions