Back to Aurora Vision Library Lite website

You are here: Start » Image » Image Spatial Transforms » ShearImage

ShearImage


Header: AVL.h
Namespace: avl

Computes a leant image (shifts the rows).

Applications: Image preprocessing when there are slanted objects.

Syntax

void avl::ShearImage
(
	const avl::Image& inImage,
	float inShear,
	avl::Axis::Type inAxis,
	avl::InterpolationMethod::Type inInterpolationMethod,
	avl::Image& outImage
)

Parameters

Name Type Range Default Description
Input value inImage const Image& Input image
Input value inShear float - - 0.0f Relative shift between consecutive rows or columns of the image
Input value inAxis Axis::Type Switches between horizontal or vertical shearing
Input value inInterpolationMethod InterpolationMethod::Type Bilinear
Output value outImage Image& Output image

Description

The filter ShearImage applies basic affine transform to each image's pixel.

Shear affine transform is defined as:

When X axis is selected

\[ \left[\begin{array}{ccc} x' \\ y' \end{array} \right] = \left[\begin{array}{ccc} 1 & inShear \\ 0 & 1 \end{array} \right] \left[\begin{array}{ccc} x \\ y \end{array} \right] \]

When Y axis is selected

\[ \left[\begin{array}{ccc} x' \\ y' \end{array} \right] = \left[\begin{array}{ccc} 1 & 0\\ inShear & 1 \end{array} \right] \left[\begin{array}{ccc} x \\ y \end{array} \right] \]

Examples

ShearImage performed on the sample image with inAxis = X, inShear = 0.50.

Errors

List of possible exceptions:

Error type Description
DomainError inImage and outImage are not distinct in ShearImage.