Please enable JavaScript to view this site.

IDS peak 2.10.0 / uEye+ firmware 3.34

Navigation: C: Programming with IDS peak > How to program

Transform images (flip, rotate)

Scroll Previous Top Next More

IDS Peak comfortSDK, genericSDK, IPL, and AFL developer manuals are external documents. Please contact us if you need them.

In addition to the Bayer conversion, other conversion functions are available in IDS peak IPL that can be applied to the camera’s images. These are performed using objects similar to peak::ipl::ImageConverter (see Converting images). Additionally, you can retrieve information about the image (pixel values of a row/column, histogram, value at an image position) and load or save images.

Name

Function

peak::ipl::ColorCorrector

Performs color correction, see Applying color correction.

peak::ipl::GammaCorrector

Performs gamma correction.

peak::ipl::ImageTransformer

Performs flips and rotations.

peak::ipl::ImageReader

Creates an image (peak::ipl::Image) from an image file.

peak::ipl::ImageWriter

Saves an image (peak::ipl::Image) into an image file, see Saving/loading images.

peak::ipl::PixelColumn

Creates a vertical intensity profile for a special column of an image, see Image data and histogram.

peak::ipl::PixelRow

Creates a horizontal intensity profile for a specific line of an image, see Image data and histogram.

peak::ipl::Histogram

Returns a histogram of the image, see Image data and histogram.

Flipping an image

After converting the Bayer image in the image acquisition loop, the flipping is performed via a peak::ipl::ImageTransformer object. This object should be created previously in a central part of the program.

genericC++

peak::ipl::ImageTransformer m_imageTransformerIPL;

Flipping in X direction with creation of a new peak::ipl::Image

genericC++

auto imageTransformed = m_imageTransformerIPL.MirrorLeftRight(image);

Flipping in X direction into an existing peak::ipl::Image

genericC++

m_imageTransformerIPL.MirrorLeftRightInPlace(image);

Flipping in Y direction with creation of a new peak::ipl::Image

genericC++

auto imageTransformed = m_imageTransformerIPL.MirrorUpDown(image)

Flipping in Y direction into an existing peak::ipl::Image

genericC++

m_imageTransformerIPL.MirrorUpDownInPlace(image);

Flipping in both directions with creation of a new peak::ipl::Image

genericC++

auto imageTransformed = m_imageTransformerIPL.MirrorUpDownLeftRight(image);

Flipping in both directions into an existing peak::ipl::Image

genericC++

m_imageTransformerIPL.MirrorUpDownLeftRightInPlace(image);

Rotation of the image by 180 degrees

genericC++

// Rotate and create new image
auto imageRotate = m_imageTransformerIPL.Rotate(image, peak::ipl::ImageTransformer::RotationAngle::Degree180);
 
// Rotate in place
m_imageTransformerIPL.RotateInPlace(image, peak::ipl::ImageTransformer::RotationAngle::Degree180);

Rotation of the image by 90 degrees clockwise

genericC++

// Rotate and create new image
auto imageRotate = m_imageTransformerIPL.Rotate(image, peak::ipl::ImageTransformer::RotationAngle::Degree90Clockwise);
 
// Rotate in place
m_imageTransformerIPL.RotateInPlace(image, peak::ipl::ImageTransformer::RotationAngle::Degree90Clockwise);

Rotation of the image by 90 degrees counterclockwise

genericC++

// Rotate and create new image
auto imageRotate = m_imageTransformerIPL.Rotate(image, peak::ipl::ImageTransformer::RotationAngle::Degree90Counterclockwise);
 
// Rotate in place
m_imageTransformerIPL.RotateInPlace(image, peak::ipl::ImageTransformer::RotationAngle::Degree90Counterclockwise);

Complete example: image acquisition loop with flipping and rotation

By using the "InPlace" functions, the result image is automatically written into the existing image.

© 2024 IDS Imaging Development Systems GmbH