您的浏览器与网页部分内容不兼容,请及时更新。 点击此处了解如何更新浏览器。

OK
网上商店

How to Find Valid Values for SetIntValue(int64_t value) on Enumeration Node „PixelFormat“?

If you are using the pylon camera class CInstantCamera and you want to access camera features, you will need to obtain a NodeMap from the camera. This NodeMap contains a Node for every implemented camera feature. This approach is defined by the Generic Interface for Cameras standard (GenICam).

The GenICam standard can be downloaded from this link (*).

According to the GenICam standard, all public features of a camera device must be included in the camera‘s GenICam XML file and must use the GenICam Standard Feature Naming Convention (SFNC), that means, they must use the SFNC Name and Interface type for those features if they exist.

The Standard Feature Naming Convention can be downloaded from this link (*).

The feature „PixelFormat“ is one of those standard features listed in the SFNC as a recommended feature and the interface type is defined as IEnumeration.

Common to all nodes that contain a value are the access methods ToString() and FromString() (inherited through the base interface IValue), that is, a node’s value can be read and written as string.

Specific nodes offer additional specific access methods, e.g. the interface type IEnumeration offers SetIntValue() and GetIntValue() in addition to ToString()/FromString().

The GenICam GenApi Reference Implementation defines the interfaces but it does not define any valid value range nor any enumeration values to be used for a specific feature, like as „PixelFormat“.

The GenICam GenApi Reference Implementation can be downloaded from here (*).

So, how do we know, which PixelFormat string corresponds to which IntValue?

GenICam (as a collection of standards) also defines GenICam Pixel Format Names and Values, where the Pixel Format Name is the string (Symbolic Name) to be used with ToString()/FromString() and the 32-bit Value is the IntValue to be used with SetIntValue()/GetIntValue().

The complete list of defined pixel formats can be downloaded from here (*).

The pylon SDK comes with it’s own, Basler specific enumeration for common Pixel Formats, EPixelType (PixelType.h). In addition, there’s a helper class CPixelTypeMapper (PixelTypeMapper.h). This helper class can be used to map between GenICam values (string or IntValue) and pylon’s EPixelType enumeration.

The following mapping functions are available:

EPixelType GetPylonPixelTypeFromNodeValue(int64_t nodeValue) const;
static EPixelType GetPylonPixelTypeByName(const char* pszSymbolicName);
static EPixelType GetPylonPixelTypeByName(const String_t& symbolicName)
static const char* GetNameByPixelType(EPixelType pixelType, SFNCVersion sfncVer = SFNCVersion_pre2_0);

The latter function mapping from EPixelType to the GenICam Symbolic Name needs a SFNC Version hint. That is because some pixel format names have been changed in SFNC Version 2.0.0.

Which SFNC version the camera is compatible with, can be obtained by calling camera.GetSFNCVersion().

[The sample code attached shows those different ways of accessing the PixelFormat feature.]

(*) If one of the above mentioned links doesn’t work and/or for an overview to all available downloads, goto: https://www.emva.org/standards-technology/genicam/genicam-downloads/

我们很乐意为您提供协助

销售咨询
支持服务
中国区代理商
定制相机