IDS Peak comfortSDK, genericSDK, IPL, and AFL developer manuals are external documents. Please contact us if you need them.
•Debayering in the software (IDS peak IPL)
•Image conversion in the camera
•Querying supported source pixel formats in the camera as strings
•Querying the current source pixel format as string
•Setting the source pixel format as string
•Image conversion in IDS peak IPL
•Creating an image with target pixel format (BGRa8) directly from buffer
•Alternative 1: Creating a peak::ipl::image first and converting it later
•Alternative 2: Specifying a previously created image buffer as the target for conversion
•Alternative 3: Mix of alternative 1 and 2
•Alternative 4: Setting the conversion mode first via a Converter object
Fig. 298: Debayering in the camera
Debayering in the software (IDS peak IPL)
Fig. 299: Debayering in IDS peak IPL
Image conversion in the camera
To get already converted color images from the camera, the source pixel format must be set to an appropriate color format. For example, if an RGB format with 8 bits per color channel is selected, then this is 24 bits of data per pixel (= 3 bytes). The required bandwidth on the transfer line is thus 3 times as high as for the transfer of a Bayer format.
Querying supported source pixel formats in the camera as strings
genericC++ |
---|
for (const auto& entry : nodemapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("PixelFormat")->Entries()) |
Querying the current source pixel format as string
genericC++ |
---|
std::string format = nodemapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("PixelFormat")->CurrentEntry()->SymbolicValue(); |
Setting the source pixel format as string
genericC++ |
---|
nodemapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("PixelFormat")->SetCurrentEntry("RGB8"); |
Image conversion in IDS peak IPL
The conversion of Bayer images can be done in IDS peak IPL. For this, the function library offers useful conversion functions. In the following example, Bayer images are received in the image acquisition loop and then converted to RBG format (see Receiving images). The ConvertTo() function creates a new IDS peak image with the desired target pixel format (IDS peak IPL::Image). Afterwards, the buffer can be returned to the buffer pool.
Note that only with the "ConvertTo()" function a copy of the buffer is created. Before this, the buffer must not be returned to the buffer pool, otherwise the data may be overwritten! |
The quality and speed of the conversion can also be set.
Fast |
Conversion mode optimized for minimum processing effort with slightly lower quality |
---|---|
HighQuality |
Conversion mode optimized for quality, with slightly higher processing effort |
Classic |
Conversion mode with compatibility to uEye camera models. In terms of speed, comparable to "Fast". |
Creating an image with target pixel format (BGRa8) directly from buffer
Alternative 1: Creating a peak::ipl::image first and converting it later
This method will be needed later on, if further operations are to be done on the Bayer image before the Bayer conversion.
genericC++ |
---|
while (m_running) |
Alternative 2: Specifying a previously created image buffer as the target for conversion
Prerequisite The created buffer has the correct size. In case of a BGRA8 conversion, this means 4x the size of the original Bayer buffer. The following example creates a QImage that can be easily displayed in a QWidget application. The image data area of the QImage is passed directly to the "ConvertTo()" function. The converted data will be written there. In addition to the pixel format, the "ConvertTo" function requires a pointer to the destination buffer and the size of this buffer. The function also creates a peak::ipl::Image from the image data and returns it.
m_imageWidth and m_imageHeight are the known values for the image width and height.
genericC++ |
---|
while (m_running) |
Alternative 3: Mix of alternative 1 and 2
genericC++ |
---|
while (m_running) |
Alternative 4: Setting the conversion mode first via a Converter object
The conversion mode can also be preset independently of the image acquisition loop. For this, a so-called ImageConverter must be created and then the parameter must be set.
genericC++ |
---|
peak::ipl::ImageConverter m_imageConverterIPL; |
The conversion in the image acquisition loop is subsequently performed via the ImageConverter.
genericC++ |
---|
while (m_running) |