Angle invariant 1D Barcode detection
Switch branches/tags
Nothing to show
Clone or download
Latest commit c4275b3 May 13, 2014
Permalink
Failed to load latest commit information.
dataset Final version Apr 29, 2014
include final version Apr 29, 2014
nbproject minor fix Apr 29, 2014
src final version Apr 29, 2014
utils-3rdparty final version Apr 29, 2014
.gitignore fist refactoring still ongoing Apr 29, 2014
LICENSE add license Apr 28, 2014
Makefile added source code, still to refactor Apr 28, 2014
README Update README May 13, 2014
example_whitelist.txt Final version Apr 29, 2014
main.cpp minor fix Apr 29, 2014
net61x3.net added source code, still to refactor Apr 28, 2014

README

Requirements
----

° Any C++08 compiler (actually used g++ 4.8.1)
° OpenCv 2.4.* with Qt 4 support enabled
° Boost 1.53 or more recent builds



Compile on Linux machine
----

Just type 'make' in the root directory of the project.
The executable will be placed there if no errors occur.

This package is meant to be compiled and used in a linux environment.
Anyway, it should be straightforward to adapt it to different architectures as both the OpenCv and Boost libraries are cross-platform. 
In order to facilitate it, the shared library linked by the makefile are:
° boost_filesystem
° boost_system
° boost_chrono
° boost_program_options
° opencv_core
° opencv_highgui
° opencv_ml
° opencv_imgproc

If you encounter any problem check if the required libraries are installed in your system.



Usage
----

Type './barcodedetection --help' to print the help message.

Command line arguments:
	-d or --dataset: full path of the directory that contains the dataset. It must constain two subdirectories: 
		 	 'Original' with the actual images, 'Detection' with the detection masks, all in png format.
			 Detection masks are black images with white-filled bounding-boxes.
			 
	-s or --show: show in a GUI some intermadiate images taken at each step of the algorihtm.
		      Press the spacebar to continue to the next image.

	-q or --quiet: no verbose output
	
	-o or --output: set an existing directory to save some intermediate result.

	-w or --whitelist: specity a text file containing the image names (one per line) you want to process from the dataset directory.
			   Image names that do not match any element of the list are skipped.

Dataset:
	The default dataset directory contains some images.
	You can download the full dataset at
		http://artelab.dicom.uninsubria.it/downloads/datasets/barcode/hough_barcode_1d/hough_barcode_1d.html
	You should use the dataset no.2 plain.

Example:

	> mkdir output
	> make clean && make
	> ./barcodedetection -s -o output
	
In the directory 'output' you will also find the intermediate images.


Output
----

For each image, the program prints the detected angle, the jaccard overlap accuracy and the time employed.
When it ends, it returns the average overlap accuracy, the average time and a set of 10 values.
We set a varying threshold from 0.1 to 1 with step 0.1 (therefore 10 thresholds).
For each threshold, these values are the ratio of images whose detection bounding boxes have an overlap accuracy greater or equal the threshold.
So, i.e., the fifth value represents the percentage of images that obtain an accuracy greater then 0.5.

Jaccard accuracy is the standard union over intersection ratio.


Acknowledgements and license
----

The conditions are described in LICENSE.

If you use this code, part of it or the dataset, please cite the following reference

	Robust Angle Invariant 1D Barcode Detection
	Alessandro Zamberletti, Ignazio Gallo and Simone Albertini
	The 2nd Asian Conference on Pattern Recognition (ACPR), 2013
	Okinawa, Japan


Bibtex:
	@inproceedings{zamberletti2013acpr,
		author = "Alessandro Zamberletti and Ignazio Gallo and Simone Albertini",
		title = "Robust Angle Invariant 1D Barcode Detection",
		booktitle = "In proceedings of the 2nd Asian Conference on Pattern Recognition (ACPR)",
		year = "2013"
	}