extrapolate_mask only considers 2D images and cannot be applied to color images
Currently, the extrapolate_mask
function only takes 2D (gray) images, but no color images. Many other related functions, for example, rotate
works on color images.
Currently, I use a work-around for color images, for example:
# get data
import numpy, bob.ip.base
image = numpy.ndarray((100,100), numpy.uint8)
rotated = numpy.ndarray(bob.ip.base.rotated_output_shape(image, 45))
imask = numpy.ones((100,100), numpy.bool)
omask = numpy.ones(rotated.shape, numpy.bool)
# rotate image
bob.ip.base.rotate(image, imask, rotated, omask, 45)
# extrapolate border
for i in range(3):
bob.ip.base.extrapolate_mask(omask, rotated)
However, this does not work for the second way of extrapolation, where random noise is added. When adding this noise to the three color components individually, weired color effects might occur. Having a function to only modify the intensity of the color might be a better solution.