A program that uses OpenCV3 for finding droplets during condensation. Gives droplet number densities based on the Rose model of dropwise condensation.
- Python 3
- OpenCV
- NumPy
- PyQt5
Clone the repository inside your current directory:
$ git clone https://github.com/alex-wuu/detect-droplets.git detect-droplets
$ cd detect-droplets
Install virtualenv if you don't have it:
$ pip install virtualenv
Create your virtual environment with virtualenv if desired. venv
can be changed to the virtual environment name of your choice:
$ virtualenv venv
Activate your virtual environment:
$ source venv/bin/activate
Install package dependencies with pip:
$ pip install -r requirements.txt
With your virtual environment activated, run with the following command:
$ python app.py
You can also build the program with PyInstaller and then run it (sudo
might be needed to run the program):
$ pip install pyinstaller
$ pyinstaller app.py
$ sudo ./dist/app/app
You should see a window like this:
Select the directories for your images and output, and then enter in your settings in the window that comes up from clicking Settings/Run:
Processed images will be saved as a JPEG to the directory of your choice with filenames ending in _out
and a CSV file named out.csv
will contain the number densities for each range of droplet sizes. A settings file is also saved as settings.csv
in the output directory.
Parameters for cv2.HoughCircles
(named Canny Edge Threshold and Accumulator Threshold here) will need to be set and played around with to achieve good results. See the OpenCV documentation and Wikipedia for more information.
Click the Run button and wait for the processing to finish.
Here is an example of what the output image can look like. The original image is first, the output image is second, and the settings are in the above image of the settings window. This is an image of dropwise condensation on a Teflon coated silicon substrate.