Question: Please help me figure out what I am doing wrong to implement this. def transpose(image): Returns True after transposing the image All plug-in functions
Please help me figure out what I am doing wrong to implement this.
def transpose(image): """ Returns True after transposing the image All plug-in functions must return True or False. This function returns True because it modifies the image. It transposes the image, swaping colums and rows. Transposing is tricky because you cannot just change the pixel values; you have to change the size of the image table. A 10x20 image becomes a 20x10 image. The easiest way to transpose is to make a transposed copy with the pixels from the original image. Then remove all the rows in the image and replace it with the rows from the transposed copy. Parameter image: The image buffer Precondition: image is a 2d table of RGB objects """ # Change this to return True when the function is implemented imageT = np.array(image).T.tolist() image.clear() for i in image: list.append(imageT)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
