Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 5 . Add Image Transposition The function transpose does not have any parameters other than image. Implement this function as specified. It is very
Add Image Transposition
The function transpose does not have any parameters other than image. Implement this function as specified. It is very similar to the function of the same name shown in the videos for the module Programming with Nested Lists. Download this function from the Canvas page if you need a hint.
This function will look like it rotates the image, but its slightly different. It actually rotates and flips. You should test it out on the less symmetrical images. For example, the command
python pictool.py transpose imagesJapanpng Japanpng
should perform the following conversion:
def transposeimage:
Returns True after transposing the image
All plugin 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 x image becomes a x 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 d table of RGB objects
# Change this to return True when the function is implemented
return False
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started