Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Image » Image Vector Transforms » ResizePixelVectors

ResizePixelVectors


Module: FoundationBasic

Rescales an image treating pixels as vectors.

Name Type Range Description
inImage Image Input image
inRoi Region* Region of interest
inVectorLength Real 0.0 - Desired vector length after normalization
outImage Image Rescaled image

Description

The filter treats pixels as a vector (each channel value as a coordinate). The operation scales pixels values to desired vector length:

\[ \begin{aligned} \lvert \lvert Pixel \rvert \rvert &= \sqrt{Pixel.X^2 + Pixel.Y^2 + Pixel.Z^2 + Pixel.W^2}\\ Pixel.X &= \frac{Pixel.X}{\lvert \lvert Pixel \rvert \rvert}\cdot inVectorLength\\ Pixel.Y &= \frac{Pixel.Y}{\lvert \lvert Pixel \rvert \rvert}\cdot inVectorLength\\ Pixel.Z &= \frac{Pixel.Z}{\lvert \lvert Pixel \rvert \rvert}\cdot inVectorLength\\ Pixel.W &= \frac{Pixel.W}{\lvert \lvert Pixel \rvert \rvert}\cdot inVectorLength \end{aligned} \]

Remarks

If a vector length of a pixel from an input image is zero, the output value equals zero.

If computed channel value exceeds its range, it is cut to maximal allowed value. Therefore the resulting vector length can be smaller than desired.

Computed values are rounded down to the next integer for integer pixel types.

Hardware Acceleration

This operation supports automatic parallelization for multicore and multiprocessor systems.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Region exceeds an input image in ResizePixelVectors.

Complexity Level

This filter is available on Expert Complexity Level.

See Also

  • NormalizeImage – Rescales an image linearly, so that its minimum becomes inNewMinimum and the maximum of the remaining pixels becomes inNewMaximum.