I've coded this depth.py file aiming at achieving a faster way to computer DoF data of a given image.
This script uses the MiDaS model to calculate depth information from a set of images. The script generates depth maps, providing a visual representation of depth for each image. Additionally, it computes average, maximum, and minimum depth values, which are stored and can be used for further analysis.
- Python 3.x
- PyTorch
- OpenCV
- Matplotlib
- NumPy
After using pip to install the required libraries simply change the input and output path to your desired path and run depth.py
Below are examples of the script output showing a side-by-side display of the original images and their depth maps, with the depth statistics printed below each pair.