This project includes a Python script that searches for image files within a specified directory, applies histogram equalization to enhance their contrast, and saves the modified images in a new subdirectory. It automates image processing tasks and helps in improving the contrast of images.
Before running this script, ensure that you have a Python environment set up and the required libraries installed.
To install the necessary library, run the following command:
- Download the script.
- Set the
test_dir
variable in thelist_full_paths_in_subfolders
function to the path of your target directory. - Execute the script.
Upon execution, the script will search for all image files in the specified directory, equalize their histograms, and save them in a subfolder named equilized_hist
.
- The
list_full_paths_in_subfolders
function searches for the paths of image files within the specified directory and returns a list of these paths. - The script loads each image file in grayscale and uses the
cv2.equalizeHist
function to equalize its histogram. - The equalized images are saved in a new subfolder named
equilized_hist
, located in the same directory as the original images.
If you are interested in contributing to this project, please submit a pull request or report any issues.