A simple Python application to view HSV (Hue, Saturation, Value) values of pixels in an image using OpenCV. Click on any pixel to see its HSV values and track statistics across multiple clicks.
- Interactive HSV Analysis: Click on any pixel to view its HSV and RGB values
- Real-time Statistics: Track minimum, maximum, and average HSV values across clicked pixels
- Multiple Display Windows:
- Main image viewer
- HSV info panel showing clicked pixel details
- Statistics panel showing aggregated data
- Statistical Analysis: View ranges and averages for all clicked pixels
- Undo/Reset Functionality: Remove last clicked pixel or reset all statistics
- Auto-resize: Large images are automatically resized to fit screen
- Python 3.6+
- OpenCV 4.5.0+
- NumPy 1.19.0+
- Clone or download this repository
- Install dependencies:
pip install -r requirements.txt
python hsv_viewer.py <image_path>python hsv_viewer.py my_image.jpg- Left Click: View HSV values at clicked position
- 'q' or ESC: Quit application
- 'r': Reset all statistics
- 'c': Clear last clicked pixel
- 's': Save current HSV info (not yet implemented)
--version: Show version information-h, --help: Show help message
For each clicked pixel, the application displays:
- Position: X, Y coordinates
- RGB Values: Red, Green, Blue values (0-255)
- HSV Values:
- Hue (0-179)
- Saturation (0-255)
- Value/Brightness (0-255)
The statistics window shows:
- Averages: Mean HSV values across all clicked pixels
- Minimums: Lowest HSV values encountered
- Maximums: Highest HSV values encountered
- Ranges: Difference between max and min values
HSV Viewer 1.0