Which book first mentioned the principle of pinhole imaging in the Middle Ages?

Mo Jing's description of pinhole imaging more than two thousand years ago is exactly the same as that of photographic optics today.

Mo Zhai (Mozi), a scholar from China, and his students made the world's first pinhole inverted image experiment, explained the reasons of pinhole inverted image, and pointed out the essence of linearity of light. This is the first scientific explanation for the straight-line propagation of light. In the Book of Mo, it is recorded that pinhole imaging is like this: "When the scene arrives, it will end in the afternoon, and it will grow with the scene. Let's talk about it at last. "