View (live demonstration)
This repository contains a Python tool that utilizes OpenCV for real-time color-based image segmentation and filtering. It enhances the contrast of an image using CLAHE before performing color thresholding.
It provides a simple graphical interface with trackbars for adjusting the color range in terms of hue, saturation, and value (HSV). The program loads an image, applies the selected color range as a mask, and displays the original image, the HSV representation, the mask, and the filtered image in a stacked layout. Users can fine-tune the color filtering settings with the trackbars.
- Contrast Enhancement: Utilizes CLAHE with a default clip limit of 1 to enhance image contrast and improve visibility without compromising specific regions' brightness or darkness.
- Real-time Color Filtering: Adjust color filtering settings using trackbars.
- Visualization: Displays the original image, HSV representation, color mask, and filtered result.
- Interactive Image Editing: Supports computer vision and image processing tasks with an intuitive interface.
- Deployment: Application deployment using Flask framework with an HTML frontend for user-friendly image processing tasks.
To use the tool:
- Clone the repository to your local machine.
- Ensure you have PyCharm installed.
- Install the required dependencies using the
requirements.txt
file. - To run the tool, open test.py, change the image path, and run the script.
- To deploy the application using Flask, run app.py and navigate to
http://127.0.0.1:5000
.