A pinhole camera is a simple version of a camera, which does not have a lens. It is a light proof box with a small hole (the size of a pin tip) on one side and a screen on the other side. A pinhole camera works in a similar way to the eye.
In the diagram above, you can see that the light rays hit the screen at the back, and then the image is projected onto the screen. As the image can be projected onto the screen, it is called a real image. This projected image is different from a mirror image, which we call a virtual image.
Like the eye, the image formed on the screen is upside down. However, the retina in our eyes sends this information to the brain, which then turns the image the right way up so we can see it correctly. In a simple pinhole camera, the image formed will be upside down.
There are many similarities between the pinhole camera and the eye. The pinhole acts like the pupil, the hole at the centre of the iris that lets light through, forming an upside-down image. However, an eye has a much more complex structure.
The convex lens is right behind the pupil. It can get thinner or thicker, allowing us to see both far-away and up-close objects. Also, the convex lens bulges out on both sides, helping to focus light on the retina, which is the focal point.