United States
Environmental Protection
Agency
EPA/600/R-17/408 | July 2017
www.epa.gov/homeland-security-research
Office of Research and Development
Homeland Security Research Program
UTR: QR Code Reading System

-------
EPA/600/R-17/408
UTR: QR Code Reading System
Version: 1
July 2017
Office of Research and Development
National Homeland Security Research Center (NHSRC)
Decontamination and Consequence Management Division (DCMD)

-------
Table of Contents
1.	Summary	3
2.	Install Instructions	3
3.	Operating Instructions	3
4.	Acknowledgements/Contact information	5
5.	References	6
Table of Figures
Figure 1. QR Home Screen	4
Figure 2. Browse for Folder Dialog Box	4
Figure 3. Video Source Dialog Box	5

-------
1. Summary
The QR Code Reading System is a Python based script developed to recognize and record data
and time associated with QR codes using web cameras. This code was originally developed to
support timekeeping efforts during the Underground Transportation Restoration (UTR)
Operational Technology Demonstration (OTD). Specifically, the system was used to track the
movements of personnel within the contaminated structure, and to measure the amount of
time it took personnel entering the facility to perform their duties. The system uses USB-
interface webcams along with the open-source python-based software called Zbar [1]. The
system was designed to read 8-1/2 x 11 inch laminated QR codes attached to personnel donned
in PPE. QR stations (consisting of a laptop and webcam) were staged at various entry and exit
points, and recorded each passerby's name and time spotted. The resulting entry and exit times
were later used to estimate entry durations.
In addition to the uses listed here, the QR Code Reading System source code could be expanded
to serve other purposes. The code is being released as open source and is fully customizable.
The following sections describe how to install and operate the QR Code Reading System. For
troubleshooting, refer to the contact information listed in Section 4.
2.	Install Instructions
The QR system was developed using the Python programming language. Zbar, the bar code
scanning package, was developed by Jeff Brown (spadix@users.sourceforge.net) [1]. Both
software packages must be installed in order for the QR Code Reader to operate as intended.
For installation details, refer to each software's documentation. Note that the software must be
installed in the order listed below.
1.	Python 2.6 (python-2.6.msi): Windows runtime for Python
https://www.python.Org/download/releases/2.6.9/
2.	Zbar (zbar-0.10-setup.exe): software for reading bar codes
http://zbar.sourceforge.net/download.html
3.	Zbar Python (zbar-0.10.win32-py2-6.exe): Zbar python extension
https://pvpi.python.org/pypi/zbar
3.	Operating Instructions
The following steps describe how to operate the QR Code Reading System.
1. Once everything is installed, double click the "QR Camera Script.py" file. A command
window will appear that looks similar to Figure 1 below.

-------
•* C:\Python26\python.exe
S
: \_/ /<_•> ! ! ! : i \_/ / \
! ! ! IV \ \ V' /I
•W \_! \_! <_> WV.V
US Environmental Protection Agency
Tinothy Boe: boe.tiinotliyPepa.cfou
Paul Lemieux: lemieux.paulPepa.gou
IMPORTANT: DO NO CLOSE OR MINI HIZE THIS WINDOW
Enter a unique name for caraera:
I 1 y	II	I j	\ I I *
1 « /	« I _ I / _ N I _	_
• V	V • ! ¦
i\	 \i I_ i
Figure 1. QR Home Screen
2.	Enter a unique name for the camera (this will be added to the filename) and hit ENTER.
Note that a file extension should not be included with the name.
3.	The "Browse for Folder" dialog box will appear as shown in Figure 2. Select a folder
where the QR results should be saved and select OK.
Browse for Folder	X
Please select a local directory for saving output
C:\psersyjTR OTD Laptop 3
UTR OTD Laptop 3

> UTR OTD Laptop 3
A
> Windows

> — RECOVERY (p:)

_ DVD RW Drive (E:)

> Archive

Gotham Sheild

QR System

QR System Storage
V
OK
Cancel
Figure 2. Browse for Folder Dialog Box
4. Another "Browse for Folder" dialog box will appear. The QR System has the ability to
save QR results in two separate locations. This was done in the event the user wanted to
store data in a local directory as well as a network directory. This step is optional -
repeat step 3 if necessary; otherwise, click Cancel.

-------
5. Lastly, video source dialog box will appear. Using the dropdown box, as shown in Figure
3, select the video source (i.e., webcam) and press OK.
Video Source
Capture Source
Select a Video Device:
X
Logitech HD Pro Webcam C92D
E
OK
]
Cancel
Apply
Figure 3. Video Source Dialog Box
6.	The camera feed will now launch. Note that this may take up to 10 seconds. The
command window will remain open. The software is now operational and will recognize
and store QR codes until closed.
7.	When the software spots a QR code, a green square will be placed around the code and
the data the QR code represents and date and time information will be displayed in the
command window. The resulting data are stored in a csv file in the save location
specified in steps 3 and 4.
8.
9.
To close the system, click the close button located on the command window's title bar.
The camera window will automatically close.
For more information or troubleshooting, refer to the contact information listed in the
following section.
4. Acknowledgements/Contact information
Timothy Boe
US EPA Office of Research and
Development
National Homeland Security Research
Center
boe.timothy@epa.gov
Paul M. Lemieux, PhD
US EPA Office of Research and
Development
National Homeland Security Research
Center
lemieux.paul@epa.gov

-------
5. References
1. Brown, J. (2011, July 15). ZBar bar code reader. Retrieved August 05, 2016, from
http://zbar.sourceforee.net/

-------
vvEPA
United States
Environmental Protection
Agency
PRESORTED STANDARD
POSTAGE & FEES PAID
EPA
PERMIT NO. G-35
Office of Research and Development (8101R)
Washington, DC 20460
Official Business
Penalty for Private Use
$300

-------