There are commercial solutions for this, but I believe they cost thousands or tens of thousands of euro. As far as I know, soil imaging is mostly done to measure root growth. I could ask my colleague about the recent technological advances in the field.
I have heard that people use (A4?) scanners for this purpose as well. Obviously they require more power and need some environmental sealing as well.
In the link there are some instructions for state-of-the-art root growth measurements using minirhizotrons: https://www.researchgate.net/publication/215605372_Minirhizotron_Techniques
The idea is that you bury the transparent tubes into the soil, let them be there several years, drop the camera into the tube every month or so, and measure the root growth/senescence from a digital image on a computer. By the way, analyzing the data on a computer requires quite heavy subjective interpretation…
The more advanced systems allow the user to place the camera always to the same depth(s), rotate the camera 360 degrees, and so on. But I think it should be possible to do all this manually as well by installing the camera on a rod that fits tightly inside the tube. Getting the images from exactly the same places can be done using height and rotation location (e.g. 0°, 30°, 60°…) markings on the tube.
Note that as far as I know, the state-of-the-art systems are not measuring/photographing the soil constantly. Instead, the user must drop the camera there every now and then. However, with cheaper components, a relatively large soil area could be photographed automatically, without the need of manual work! This could be a huge advantage, making a cheaper and more simple system in fact better than the 100-times more expensive one.
The least, a simpler but more “automatic” (constant measurement) system could work very nicely in laboratory environment. That being said, the same observetaions at least in principle be observed by using a transparent flower pot… So instead of observing the soil from INSIDE the tube, the soil can be observed from OUTSIDE the tube as well (although it is not exactly the same).