A basic cli app which allows you to calculate the Cloud Coverage Index given a sky image.
No need to worry for pre-processing!
Since this app is all made with Python
you're going to need some python-libraries and utilities listed below.
-
First check that your current
Python
version isPython 3.6
or above, by running the following command on your terminal:$ python --version
Python 3.8+
is recommendedNote that in some linux distros you'll need to run it as:
$ python3 --version
-
You migth as well check if you have PyPI as your Python package installer:
Since this process vary for every Linux distro, I'll link you to an article explanning how to set PyPI up.
-
Clone the repo
$ git clone https://github.com/DiXap/CloudCoverageIndexCalculator.git
-
Move to project's
dir
and run the following$ pip install -r requirements.txt
-
The step above is going to automatically install packages needed for this project.
If you want to install them manually, here's a list with the packages:opencv
click
numpy
Since this is a cli
app, you're need to know the syntaxis:
$ python main.py [PATH_TO_IMAGE] [OPTIONS]
where:
-
[PATH_TO_IMAGE]
, refers to the absolute path of the image you want to processYou can use relative paths only if the image or containing folder are inside project's
dir
-
[OPTIONS]
, put as many flags as you wish in this section:Flags Description -s
Display processed image used to calculate CCI --w
Save a copy of the processed image --d
Display original image --n
Process a night-time image At any given time you can pass the
--help
or-h
to see all available flags:$ python main.py --help
For example, you can pass the following command:
$ python main.py /PATH/TO/IMAGE -s --w
and the program will show and write the image
You can even try and pass all flags at the same time!
Regardless of your flag choices, the app will always display the CCI in your terrminal:
$ python main.py /PATH/TO/IMAGE -s --d --w
CCI for image exmaple.jpg is X.XX%
Images will always be dumped inside ./dump
folder, so please, don't delete it.
You can modify this setting in IPP.py
:
def write(self, name: str, image='b&w', path='dump/'): # change path='' value
...
As was mentioned before, you can get the CCI from a night-time photo, just do as it follows:
$ python main.py /PATH/TO/IMAGE --n
You can add more flags but DO NOT forget to put
--n
, otherwhise it won't work properly
These test cases were coded to demostrate functions' error handling.
Feel free to play around with them at tests.py
.
All documentation was generated using pydoc
. You'll find it inside docs
.