IPA::Point - single pixel transformations and image arithmetic
Single-pixel processing is a simple method of image enhancement. This technique determines a pixel value in the enhanced image dependent only on the value of the corresponding pixel in the input image. The process can be described with the mapping function
s = M(r)
where r
and s
are the pixel values in the input and output images, respectively.
Combines set of images of same dimension and bit depth into one and returns the resulting image.
Supported types: Byte, Short, Long.
Parameters:
Array of image objects.
An integer constant, one of the following, that indicates how the resulting image would be adjusted in accord to the minimal and maximal values of the result. Trunc
constants cut off the output values to the bit maximum, for example, a result vector in 8-bit image [-5,0,100,300] would be transformed to [0,0,100,255]. Scale
constants scale the whole image without the cutoff; the previous example vector would be transformed into [0,4,88,255]. The Abs
suffix shows whether the range calculation would use the whole domain, including the negative values, or the absolute values only.
conversionTruncAbs conversionTrunc conversionScale conversionScaleAbs
Default is conversionScale
.
An integer constant, indicates the type of action performed between pixels of same [x,y] coordinates.
combineMaxAbs - store the maximal absolute pixel value combineSignedMaxAbs - compute the maximal absolute value, but store its original ( before abs()) value combineSumAbs - store the sum of absolute pixel values combineSum - store the sum of pixel values combineSqrt - store the square root of the sum of the squares of the pixel values
Default is combineSum
.
Discards conversionType
parameter and performs no conversion. If set to true value, the conversion step is omitted.
Default is 0.
Performs the binary thresholding, governed by minvalue
and maxvalue
. The pixels, that are below minvalue
and above maxvalue
, are mapped to value 0; the other values mapped to 255.
Supported types: Byte
Performs gamma correction of IMAGE by a product of origGamma
and destGamma
.
Supported types: Byte
Performs image mapping by a passed lookup
array of 256 integer values. Example:
IPA::Point::remap( $i, lookup => [ (0) x 128, (255) x 127]);
is an equivalent of
IPA::Point::threshold( $i, minvalue => 128);
Supported types: 8-bit
Subtracts IMAGE2 from IMAGE1. The images must be of same dimension. For description of conversionType
and rawOutput
see combine.
Supported types: Byte
Test every pixel of IMAGE whether it equals to test
, and assigns the resulting pixel with either match
or mismatch
value. All test
, match
, and mismatch
scalars can be either integers ( in which case mask
operator is similar to threshold ), or image objects. If the image objects passed, they must be of the same dimensions and bit depth as IMAGE.
Supported types: Byte, Short, Long.
Combines images of same dimensions and bit depths, passed as an anonymous array in LIST and returns the average image.
Supported types: Byte, Short, Long, 64-bit integer.
Returns a histogram-equalized image.
Supported types: Byte
Returns IMAGE*a+b
.
Retuns exp(IMAGE)
Retuns log(IMAGE)