These scripts need python 2.7+ and the following libraries to work:
The simplest way to install all of them is to install python(x,y).
If you can't install python(x,y), You can install python, numpy and python-opencv seperately, then install pip and pillow.
cv2.pyd
to the lib/site-packages
folder on your python installation path.python get-pip.py
pip install pillow
. If you are running the code under Linux/Mac OS X and the scripts throw AttributeError: __float__
, make sure your pillow has jpeg support (consult Pillow's document) e.g. try:
sudo apt-get install libjpeg-dev
sudo pip uninstall pillow
sudo pip install pillow
If you have any problem installing the dependencies, contact the author.
To generate all results, enter the src
directory, run
python main.py
It will use images under dataset
directory to produce the results. The results will show up in result
directory. Intermediate results will be saved too.
To see how long the script will need to generate the results (without saving them or the intermediate images), run
python main.py -t
To generate resized final results (by 1/3), run
python main.py -r
To generate intermediate results, run
python main.py -i
Or if you want resized intermidate results:
python main.py -i -r
.
├─ README.md
├─ doc (report and other documents)
│ └── ...
├─ dataset (source images)
│ └── ...
├─ result (the results)
│ └── ...
└─ src (the python source code)
├── perspective.py (perspective correction module)
└── main.py (generate the results for the report)