The first person to realize that light enters the eye, rather than leaving it, was the 10th-century Muslim mathematician, astronomer and physicist Ibn al-Haytham. He invented the first pinhole camera after noticing the way light came through a hole in window shutters. The smaller the hole, the better the picture, he worked out, and set up the first Camera Obscura (from the Arab word qamara for a dark or private room). He was also credited with being the first man to shift physics from a philosophical activity to an experimental one.
Pinhole cameras are one of the earliest styles of camera ever created. So what is a pinhole camera? It is essentially a small-enclosed box with a tiny hole placed on one of the sides. When light is allowed to entire through the tiny hole, an image of the object directly outside the hole is projected onto the opposite side of the box. We will explore pinhole camera history a little deeper so you learn more about how they first came into being. Many scientists and others observed and wrote about the phenomenon from the ancient Chinese to the Greeks.
But it wasn't until the 11th century that someone actually wrote about the principals of the pinhole camera and created the camera obscura to study it. Ibn al-Haytham wrote his "Book of Optics" in 1021, and created his own pinhole camera, then later the camera obscura. Al-Haytham discovered he could sharpen his reflected, inverted image by shrinking the pinhole or aperture. Essentially, a pinhole camera is a light-tight box, usually rounded like an oatmeal box, with a pinhole in one side. The image outside the camera is projected through the pinhole where it is reversed and shown upside down on the rear of the box.
With no film yet available to record the image, al-Haytham constructed the camera obscura, which is a room-sized pinhole camera where the observer can get inside the apparatus and observe the image. For hundreds of years, people used the camera obscura/pinhole camera to draw or paint the image projected. They used people, animals and landscapes as their models. While these images were not exact, they were an important step on the way to photography, because the pinhole camera served as a model for the first cameras. Discarded as quaint for many years, pinhole cameras first made a comeback with artists in the 1960s.
Since then, they have become the focus of hobbyists, Cub Scout packs and other educational venues. Since all it takes to build one is an oatmeal box and some light-sensitive paper or film, the pinhole camera can teach children about physics, light and photography with a little bit of the old "gosh, wow" effect. Using the pinhole technique is one of the most authentic ways to record photographic images. The technique is based on the principle of the camera obscura which is centuries old. Basically it's nothing more then a lightproof box with, in the middle of one side, a tiny little hole instead of a lens.
The light works its way through the pinhole right into the enclosed room and that is how at the opposite side of the pinhole an image appears which is upside down. We can preserve the image by putting material which is sensitive to light at the side where the image shows up and develop it after exposure. Al hazen (Ibn Al-Haytham), a great authority on optics in the Middle Ages who lived around 1000AD, invented the first pinhole camera, (also called the Camera Obscura} and was able to explain why the images were upside down. The first casual reference to the optic laws that made pinhole cameras possible, as observed and noted by Aristotle around 330 BC, who questioned why the sun could make a circular image when it shined through a square hole. http://www. muslimheritage. com/topics/default. cfm? articleID=382 Made significant contributions to the principles of optics, as well as to anatomy, astronomy, engineering, mathematics, medicine, ophthalmology, philosophy, physics, psychology, visual perception, and to science in general with his introduction of the scientific method.
He is sometimes called al-Basri after his birthplace in the city of Basra in Iraq(Mesopotamia), then ruled by the Buyid dynasty of Persia. 3] Ibn al-Haytham is regarded as the father of optics for his influential The Book of Optics, which correctly explained and proved the modern intromission theory of visual perception, and for his experiments on optics, including experiments on lenses, mirrors, refraction, reflection, and the dispersion of light into its constituent colors.  He studied binocular vision and the moon illusion, speculated on the finite speed, rectilinear propagation and electromagnetic aspects of light, and argued that rays of light are streams of energy particles travelling in straight lines. 
Ibn al-Haytham described the pinhole camera and invented the camera obscura (a precursor to the modern camera),discovered Fermat's principle of least time and the law of inertia (known as Newton's first law of motion), discovered the concept of momentum (part of Newton's second law of motion), described the attraction between masses and was aware of the magnitude of acceleration due to gravity at a distance, discovered that the heavenly bodies were accountable to the laws of physics, presented the earliest critique and reform of the Ptolemaic model, first stated Wilson's theorem in number theory, pioneered analytic geometry, formulated and solved Alhazen's problem geometrically, developed and proved the earliest general formula for infinitesimal and integral calculus using mathematical induction,and in his optical research laid the foundations for the later development of telescopic astronomy, as well as for themicroscope and the use of optical aids in Renaissance art.