March 2020
Intermediate to advanced
366 pages
9h 8m
English
Now we are almost done! If we want to use the BaseLayout class, we need to provide code for the two methods that were previously left blank, which are as follows:
We also need to change the constructor to initialize any parameters we will need—in this case, the canvas background for the pencil sketch:
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) color_canvas = load_img_resized('pencilsketch_bg.jpg', (self.imgWidth, self.imgHeight)) self.canvas = cv2.cvtColor(color_canvas, cv2.COLOR_RGB2GRAY) ...