Monochrome64 pixel data

Hello,

I use a Dalsa Genie Nano with special firmware for LineProfiler this outputs a 64bits/pixel.
image

But in the Plane information I only get 8 bits per pixel.
Is this supported? I see there is a Float64Bpp datatype?

Hi @BenDevos
how did you configure the PixelFormat (in the GenICam Browser: CVB Color Format) of the GenICam.vin driver?
It need to be set to RAW ( = 0). Other wise CVB tries to convert the pixel values to 8bit.

One further piece of advice: To get the best performance (high framerate) you might consider turning of the cvb logging, as each line is transmitted separatly

This is indeed set to RAW, still 8bpp in the LinearAccess

Where do you disable this logging?

In that case just use the base pointer and manually access each pixel with xInc = 8
The values you are looking for should be accessable by:

intptr_t elementPtr= basePtr+ i*xInc;
uint8_t valAntiScatter = *(uint8_t*)(elementPtr);
uint8_t valScatter = *(uint8_t*)(elementPtr+ 1);
uint32_t valWeightedColSum = *(uint32_t*)(elementPtr+ 2);
uint16_t valPixSum = *(uint16_t*)(elementPtr+ 6);

Please note that to work with 64bit pixel data CVB requires a VIN- and Socket-Driver of at least the following versions:

  • GenICam.vin version 2.0.17.1018
  • GEVSD.dll version 2.11.0.448

Use the LogGUI application to adjust the logging (available since CVB 13.0)

From basePtr on there are only 640 bytes (width) with a value. After that they are all zero.

Did you remember to switch Std::DeviceScanType to Linescan3D starting the grab and accessing basePtr?
If that wasn’t the cause, could you post your GenICam.vin configuration (%CVBDATA%Drivers/GenICam.ini)

Thanks Guest24 for your information!
I used the DeviceFactory.Discover() wich selected the wrong device information.
When I get the device from Vin and port number it works.

depending what work stations are active I want to prioritize some camera’s. (12 in total)
So the DeviceFactory is really handy together with Linq:

var username = d.SingleOrDefault(u => u.Key.Equals(DiscoveryProperties.DeviceUsername));

Can I set the CVB Color Format to RAW at runtime?

3 Likes

d.SetParameter(“PixelFormat”, “0”); in my foreach loop does the trick.

Thanks again guest24!

3 Likes

I totally agree regarding Linq :heart:: I often use an extension class for that case (which I extended for your raw use case) that can be used like this:

using (var deviceInfos = DeviceFactory.Discover())
{
  var device = deviceInfos.OpenDeviceByUsername("TheUsername", OpenRaw.Yes);

  ...
}

And here is the class:

enum OpenRaw
{
  No,
  Yes
}

static class DeviceFactoryExtensions
{
  public static Device OpenDeviceByUsername(this DiscoveryInformationList deviceInfos, string usernameToOpen, OpenRaw openRaw = OpenRaw.No)
  {
    if (deviceInfos == null)
      throw new ArgumentNullException(nameof(deviceInfos));
    if (usernameToOpen == null)
      throw new ArgumentNullException(nameof(usernameToOpen));
	
    var deviceInfo = deviceInfos.First(di => di.GetUsername() == usernameToOpen);
		
    if(openRaw == OpenRaw.Yes)
      deviceInfo.SetParameter("PixelFormat", "0");
		
    return DeviceFactory.Open(deviceInfo);
  }

  public static string GetUsername(this DiscoveryInformation di)
  {
    if(di.TryGetProperty(DiscoveryProperties.DeviceUsername, out var username))
      return username;
    else
      return string.Empty;
  }
}
2 Likes