Leonardo da Vinci described a camera obscura using a box and a small opening to project an image.
In a camera obscura, light from a scene passes through a small aperture into a darkened space. The light rays cross at the opening and form an inverted image on the opposite surface. Leonardo discussed this principle in his notebooks while studying vision, light, and perspective.
The camera obscura was not a camera in the modern photographic sense. It had no photographic film or electronic sensor, so the projected image disappeared when the light was removed. Artists could nevertheless use the effect to study perspective and reproduce scenes.
The principle predates Leonardo, but his explanations helped connect it with the anatomy of the eye and the geometry of image formation. Modern cameras still use the same basic idea, adding lenses and a recording surface.