def pencil_sketch(imagePath, ImageData, kernel_size, sigma): utils_ = utils(imagePath) originalImage = ImageData grayScaleImage = utils_.convert_to_grayScale(originalImage) negativeImage = utils_.image_negative(grayScaleImage) # add padding to the image padding_pixels = kernel_size // 2 image_padded = np.pad(negativeImage, ((padding_pixels, padding_pixels), (padding_pixels, padding_pixels)), 'constant') gaussian_negative = gaussian_blur(kernel_size, sigma, padding_pixels, image_padded) return dodge(grayScaleImage, gaussian_negative)
def __init__(self, imagePath): self.utils_ = utils(imagePath) self.originalImage = utils.load_image_data(self.utils_) self.grayScaleImage = utils.convert_to_grayScale( self.utils_, self.originalImage)
def __init__(self, imagePath, imageData): self.utils_ = utils(imagePath) self.originalImage = imageData
def __init__(self, imagePath, ImageData): self.utils_ = utils(imagePath) self.originalImage = ImageData self.grayScaleImage = utils.convert_to_grayScale(self.utils_, self.originalImage)