Point Algorithms

Point operations are the simplest image processing transformations. An output pixel value depends on the input pixel value only. Examples of such transformations are tone adjustments for brightness and contrast, thresholding, color space transformation, image compositing, image arithmetic or logic, etc.

Mathematically, a point operator can be written as

\[h(x,y)=g(f(x,y))\]

or

\[h = g \circ f\]

Classification of Point Operations

There are various ways to classify point operations. One way to classify them is by the number of arguments. Unary point operations take one argument, binary point operations take two arguments and tertiary point arguments take three arguments. Another way is to separate them into arithmetic, logical, and other operations. The table shows this classification for the operations implemented within nVision.

| | Arithmetic | Logic | Other | |———-|—————————————————–|————–|—————————| | Unary | Absolute, Decrement, Increment, Negate, Square Root | Not | Colorspace transformation | | Binary | Add, Difference, Subtract | And, Or, Xor | | | Tertiary |

Unary Image Operator

Applies a unary point operation to an image. Unary point operations are applied pixel by pixel, the same way for every pixel.

The following operators are available:

Absolute

Absolute.

abs ( Image ) -> Result

Decrement

Decrement by 1.

Image - 1 -> Result

Increment

Increment by 1.

Image + 1 -> Result

Negate

Negate (2’s complement).

  • Image -> Result

Not

Not (1’s complement).

~ Image -> Result

Square Root

Square root.

sqrt( Image ) -> Result

Inputs

Image (Type: Image)

The input image.

Operator (Type: string)

Specifies the operator.

operator operation
++ increment
-- decrement
- negate (2’s complement)
! not (1’s complement)
abs absolute
sqrt square root

Outputs

Result (Type: Image)

The result image.

BinaryImageConstantOperator

Applies a binary point operation between an image and a constant. Possible operations can be grouped into arithmetic, logic and comparison fields. Binary point operations are applied pixel by pixel, the same way for every pixel.

Arithmetic Operators

The following operators are available:

Add

Add with saturation.

Image + Constant -> Result

Subtract

Subtract with saturation.

Image - Constant -> Result

Difference

Difference with saturation.

abs ( Image - Constant ) -> Result

Multiply

Multiply without saturation.

Image * Constant -> Result

Divide

Divide without saturation.

Image / Constant -> Result

Multiply (Blend)

Multiply with saturation.

Image * Constant -> Result

Divide (Blend)

Divide with saturation.

Image / Constant -> Result

Logic Operators

The following operators are available:

And

Logical And.

Image & Constant -> Result

Or

Logical Or.

Image | Constant -> Result

Xor

Logical Xor.

Image ^ Constant -> Result

Comparison Operators

The following operators are available:

Smaller

Compare smaller.

Image < Constant -> Result

Smaller or Equal

Compare smaller or equal.

Image <= Constant -> Result

Equal

Compare equal.

Image == Constant -> Result

Bigger or Equal

Compare bigger or equal.

Image >= Constant -> Result

Bigger

Compare bigger.

Image > Constant -> Result

Min/Max Operators

The following operators are available:

Min

Minimum.

min( Image, Constant) -> Result

Max

Maximum.

max( Image, Constant) -> Result

Inputs

Image (Type: Image)

The input image.

Constant (Type: object)

The constant.

Operator (Type: string)

Specifies the operator.

operator operation
+ add
- subtract
diff difference
* multiply
/ divide
*_blend multiply (blend)
/_blend divide (blend)
& and
| or
^ xor
< smaller
<= smaller or equal
== equal
>= bigger or equal
> bigger
min minimum
max maximum

Outputs

Result (Type: Image)

The result image.

BinaryImageOperator

Applies a binary point operation between two images. Possible operations can be grouped into arithmetic, logic and comparison fields. Binary point operations are applied pixel by pixel, the same way for every pixel, for corresponding pixels of two images.

The following operators are available:

Add with saturation.

Image + Gradient -> Result

Subtract with saturation.

Image - Gradient -> Result

Difference with saturation.

abs ( Image - Gradient ) -> Result

Multiply without saturation.

Image * Gradient -> Result

Divide without saturation.

Image / Gradient -> Result

Multiply with saturation.

Image * Gradient -> Result

Divide with saturation.

Image / Gradient -> Result

Logic Operators

The following operators are available:

And

Logical And.

Image & Gradient -> Result

Or

Logical Or.

Image | Gradient -> Result

Xor

Logical Xor.

Image ^ Gradient -> Result

Comparison Operators

The following operators are available:

Smaller

Compare smaller.

Image < Gradient -> Result

Smaller or Equal

Compare smaller or equal.

Image <= Gradient -> Result

Equal

Compare equal.

Image == Gradient -> Result

Bigger or Equal

Compare bigger or equal.

Image >= Gradient -> Result

Bigger

Compare bigger.

Image > Gradient -> Result

Min/Max Operators

The following operators are available:

Min

Minimum.

min( Image, Gradient) -> Result

Max

Maximum.

max( Image, Gradient) -> Result

Inputs

ImageA (Type: Image)

The first input image.

ImageB (Type: Image)

The second input image.

Operator (Type: string)

Specifies the operator.

operator operation
+ add
- subtract
diff difference
* multiply
/ divide
*_blend multiply (blend)
/_blend divide (blend)
& and
| or
^ xor
< smaller
<= smaller or equal
== equal
>= bigger or equal
> bigger
min minimum
max maximum

Outputs

Result (Type: Image)

The result image.