You are here: Start » FIL.NET » Function Reference » Image » Image Vector Transforms » FIL.ResizePixelVectors
Rescales an image treating pixels as vectors.
Namespace: | FilNet |
---|---|
Assembly: | FIL.NET.dll |
Syntax
public static void ResizePixelVectors ( FilNet.Image inImage, float inVectorLength, FilNet.Image outImage )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inImage | FilNet.Image | Input image. | ||
![]() | inVectorLength | float | <0.0f, INF> | 255.0f | Desired vector length after normalization. Default value: 255.0f. |
![]() | outImage | FilNet.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.
Hardware acceleration settings may be manipulated with Settings class.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Region exceeds an input image in ResizePixelVectors. |