Prima::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.
r
s
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.
Trunc
Scale
Abs
conversionTruncAbs conversionTrunc conversionScale conversionScaleAbs
Default is conversionScale.
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.
combineSum
Discards conversionType parameter and performs no conversion. If set to true value, the conversion step is omitted.
conversionType
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.
minvalue
maxvalue
Supported types: Byte
Performs gamma correction of IMAGE by a product of origGamma and destGamma.
origGamma
destGamma
Performs image mapping by a passed lookup array of 256 integer values. Example:
lookup
Prima::IPA::Point::remap( $i, lookup => [ (0) x 128, (255) x 127]);
is an equivalent of
Prima::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.
rawOutput
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.
test
match
mismatch
mask
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.
Returns IMAGE*a+b.
IMAGE*a+b
Retuns exp(IMAGE)
exp(IMAGE)
Retuns log(IMAGE)
log(IMAGE)
To install Prima::IPA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prima::IPA
CPAN shell
perl -MCPAN -e shell install Prima::IPA
For more information on module installation, please visit the detailed CPAN module installation guide.