CrImage::MapImpl(T)
Inherits CrImage::NumericMap < CrImage::Map
A collection of implementations of NumericMap(T), intended to be included in base classes.
See IntMap, FloatMap, and ComplexMap.
Constructors
Instance methods
Divides each point in this Map by num
TODO: ComplexMap shouldn't return a FloatMap
Construct a Mask identifying all pixels smaller than num.
gray = image.to_gray # Convert color image to grayscale
mask = gray < 128 # Generate a threshold mask
mask.to_gray.save("greater_than_example.jpg") # Convert and save the mask as a black and white image
Construct a Mask identifying all pixels smaller than or equal to num. See #< for example.
Construct a Mask identifying all pixels larger than num.
gray = image.to_gray # Convert color image to grayscale
mask = gray > 128 # Generate a threshold mask
mask.to_gray.save("greater_than_example.jpg") # Convert and save the mask as a black and white image
Construct a Mask identify all pixels larger than or equal to num. See #> for near example.
Crop the map to the values contained from xstart out by xcount, and ystart out by ycount
Crop the map, returning only the values in row at ystart
Crop the map, returning only the values in column at xstart
Crop the map to the values contained in xrange and yrange
Get lement at coordinates x and y, or nil if coordinates are out of bounds
Perform a brute force cross correlation calculation with provided template.
Perform a Fast Fourier Transform cross correlation (convolution?) with provided template. See FftUtil
Performe a Fast Fourier Transform, padding out this Map so dimensions are a power of 2. See FftUtil
Construct a Mask from this GrayscaleImage using the passed in block to determine if a given pixel should be true or not
# Construct a mask identifying the bright pixels in the bottom left corner of image
image.to_gray.mask_from do |pixel, x, y|
x < image.width // 2 && # left half of image
y > (image.height // 2) && # bottom half of image
pixel > 128 # only "bright" pixels
end
->
Pad the borders of this Map corresponding to pad_type.
Convert this Map to a GrayscaleImage.
Set scale: true so that all of the values will scale, such that max will become 255u8, and min will become 0u8. All other values will be
linearly scaled between those values.