This project combines the Qt framework and OpenCV library to implement efficient image processing and compression algorithms. Through a user-friendly interface, users can easily perform operations such as image compression, decompression, and image quality evaluation.
- Main Interface Navigation: Provides clear function entrances for quick switching to different operation interfaces
- Image Compression: Supports compression of grayscale and color images
- Image Decompression: Supports decompression of previously compressed image files
- Project Introduction: Provides project background and function descriptions
- Help Documentation: Provides usage guidance and frequently asked questions
- PSNR Calculation: Supports calculating Peak Signal-to-Noise Ratio between original and processed images to evaluate image quality
├── Bits.cpp/.h # Bit operation implementations
├── Block.cpp/.h # Image block processing implementations
├── RBlock.cpp/.h # Reversible block processing implementations
├── Compress_gray.cpp/.h # Core implementation of grayscale image compression
├── compresswindow.cpp/.h/.ui # Compression window interface and functions
├── uncompresswindow.cpp/.h/.ui # Decompression window interface and functions
├── introducewindow.cpp/.h/.ui # Introduction window interface and functions
├── helpwindow.cpp/.h/.ui # Help window interface and functions
├── main.cpp # Program entrance
├── mainwindow.cpp/.h/.ui # Main window interface and functions
├── images/ # Sample images folder
├── Resources/ # Resource files folder
└── openCV_test.pro # Qt project file
This is the core processing class of the project, responsible for image compression and decompression operations:
- init_compress: Initializes compression parameters
- init_uncompress: Initializes decompression parameters
- compress: Executes image compression
- uncompress: Executes image decompression
- save: Saves compression results
- getPSNR: Calculates Peak Signal-to-Noise Ratio of images
- MainWindow: Main window that provides access to various functional modules
- CompressWindow: Compression window that provides image selection and compression operations
- uncompressWindow: Decompression window that provides compressed file selection and decompression operations
- IntroduceWindow: Introduction window that displays project information
- HelpWindow: Help window that provides usage assistance
- Qt 5.x or Qt 6.x
- OpenCV library
- C++ 17 compiler
- Ensure that Qt development environment and OpenCV library are installed
- Open the project file
openCV_test.prowith Qt Creator - Configure the project to link with OpenCV library
- Compile and run the project
- Click the "Compress" button from the main interface to enter the compression interface
- Click the "Select Image" button to choose the image file to compress
- Select grayscale or color image processing mode as needed
- Click the "Run" button to perform the compression operation
- Click the "Save" button to save the compression results
- Click the "Decompress" button from the main interface to enter the decompression interface
- Click the "Select File" button to choose the compressed file to decompress
- Click the "Run" button to perform the decompression operation
- Click the "Save" button to save the decompressed image
- Click the "Introduction" button to view project introduction information
- Click the "Help" button to view usage help documentation
The images/ directory of the project contains multiple test image files, including:
- Standard test images (such as lena512.bmp, f16.bmp, etc.)
- Image files of different formats and resolutions
- Some specific test image files
- Uses Qt framework to build cross-platform graphical interface
- Utilizes OpenCV library for image processing operations
- Implements efficient image compression algorithms
- Supports calculating PSNR to evaluate image quality
- Uses signal-slot mechanism to实现 communication between interfaces
- Ensure correct configuration of OpenCV library path
- Processing large images may take a long time, please be patient
- Compressed files are saved in .nam format
- If you encounter problems during program operation, please refer to the help documentation
This project is developed by the Qt and OpenCV developer team, aiming to provide an easy-to-use image processing and compression tool.
- V1.0: Initial version, implementing basic image compression and decompression functions