Although this is a simple question and easy… But it can be interesting for many people.
I saw this question at Stanford University. And thanks to the professor.
Question 1
Write code to fix the poppy.png image which should show an orange California Poppy in the foreground (the California state flower!).
The background is mostly green with some in the upper-right.
Primary Pseudo Code Sample
image = new SimpleImage("poppy.png");
for (pixel: image)
{
//Complate Here...
}
print(image);
Description about functions
pixel.setBlue( <number> );
pixel.setGreen( <number> );
pixel.setRed( <number> );
pixel.getRed()
pixel.getGreen()
pixel.getBlue()
How Solve
At the first, you need to know Poppy California. And how it looks.
Final Answer
Question 2
Write code to fix the oranges image which should show a box of oranges. The box itself is dull gray. The sign on the box is black, with “organic” written in light orange, and the rest of the letters in white.
Final Answer
Question 3
- The green and blue values are all just random values in the range 0..255 (“snow”)
- The data of the real image is exclusively in the red values
- In addition, the red values have all been divided by 10 (dark)
- The green/blue snow is obscuring the real image
Write code to recover the real image.
Final Answer
Question 4
Write code to fix the stop-sky image which should show a red stop sign front with a background of a light blue sky and green tree leaves.
Final Answer
Question 5
Write code to fix the puzzle-copper image. The red values in the image are random noise, so they should be set to 0.
The real image is in the blue and green values, which have been divide by 10.
Final Answer
Question 6
Write code to fix the puzzle-iron image. The red and green values in the image are random noise, so they should be set to 0.
The real image is in the blue values, which have been divide by 10. The “solution” image will look blue, since it is exclusively in the blue values, so don’t worry about that. We’ll see a way to fix that blueness in a later section.
Final Answer
Click here to view further queries.
If you tried and thought …
Click here to check the final answer.