Question: Use only NumPy to create the Smooth class. This effect is tricky, but can be implemented by detecting pixels that are outliers compared to their
Use only NumPy to create the Smooth class. This effect is tricky, but can be implemented by detecting pixels that are outliers compared to their neighbors. Set the resulting pixel value to be the mean value of a pixel and its eight neighbors. For pixels on an edge, use the mean value of the pixel and its five neighbors. For pixels on corners, use the mean value of the pixel and its three neighbors. Be careful! If you choose to loop over every pixel, then you must store your input and output arrays separately (i.e. you cannot modify the given array and return it), because otherwise you will corrupt your input data with your output.

class Smooth(ImageEffect): def apply(pixels: np.ndarray) -> np.ndarray
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
