This repository contains the undergraduate thesis project titled "Measurement of Wine Parameters Using Computer Vision" by Ilija Jazvić, completed at the Faculty of Electrical Engineering, Computer Science and Information Technology Osijek (FERIT Osijek) in 2023.
The goal of this project was to design and implement a functional system capable of measuring the pH value of wine using litmus paper and computer vision techniques.
The system was built around the ESP32-CAM microcontroller for image acquisition and the Python programming language (OpenCV) for image processing and pH value estimation.
The system captures images of litmus paper soaked in wine samples, transmits them via a web server, and processes the images to determine the corresponding pH values.
Through computer vision analysis, the program estimates color components (RGB values) and matches them with predefined color references for specific pH levels.
- Microcontroller: ESP32-CAM
- Programming environments: Arduino IDE (C/C++) and Visual Studio Code (Python)
- Libraries used:
esp32cam,WiFi.h,WebServer.h,OpenCV,NumPy,Pandas - Measurement principle: Color-based pH estimation using litmus paper
- Achieved accuracy: ~78% correct readings under variable lighting conditions
The project consists of two main software components:
-
ESP32-CAM firmware (C++)
- Captures images from the built-in camera
- Hosts a simple web server for live image streaming
- Sends captured frames for processing
-
Python image processing script
- Connects to the ESP32-CAM web server
- Extracts color data from the center of each frame
- Determines the most likely pH value based on RGB comparison
- Displays the processed image with pH annotation
The system prototype was constructed using:
- ESP32-CAM module
- Wooden mock-up providing stable lighting and camera positioning (~20 cm above paper)
- Litmus paper or color-printed pH scale for testing
- Wi-Fi connection for data transmission
Natural lighting provided the best results; artificial light sources caused unwanted reflections.
During testing, the system achieved a 78% accuracy rate in determining correct pH values across 14 reference colors.
Errors primarily occurred due to variable ambient lighting, which affected RGB readings and color interpretation.
Future improvements include:
- Controlled light conditions or artificial lighting calibration
- Machine learning–based color classification for improved precision
| Component | Purpose |
|---|---|
| ESP32-CAM | Image acquisition and web server |
| Python (OpenCV) | Image processing and pH estimation |
| Arduino IDE | Firmware development |
| Wi-Fi connection | Communication between ESP32-CAM and host computer |