Image to matrix🔗

Takes in an image and outputs a matrix.

Inputs🔗

  • image: Input image.

  • outputType: The type of the output matrix.

  • normalizeIntensity: A Boolean flag that enables or disables intensity range normalization. This flag has an effect only if outputType = Float or Double. If this flag is true and channel_min of the input image is negative, the output range is [-1, 1] where pixels with intensity channel_min are mapped to -1 and pixels with intensity channel_max are mapped to 1. Otherwise, if channel_min is greater or equal to zero, the output range is [0, 1] where pixels with intensity channel_min are mapped to 0 and pixels with intensity channel_max are mapped to 1. If this flag is false, the values of input pixels are copied to the output matrix as such. If the input is a color image, the pixels are first converted to grayscale.

Outputs🔗

  • matrix: Output matrix. If input is an ARGB color image and outputType is RgbInt32, the bytes in the elements of the output matrix are in order 0xAARRGGBB. For example, a green opaque pixel results in 0xff00ff00. Notice that this may be interpreted as a negative integer.

enum OutputType🔗

Type of the output matrix.

Values:

enumerator Bool🔗
enumerator Int32🔗
enumerator RgbInt32🔗
enumerator Float🔗
enumerator Double🔗