Skip to content

This project in conjunction with a web camera tracks how many free spots there is on the parking lot. This project should be able to run on a Raspberry Pi or a similar product.

License

Notifications You must be signed in to change notification settings

v1kt0r1337/ParkingLotTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ParkingLotTracker

This project is a proof of concept where we in conjunction with a raspberry pi with an attached pi camera use camera recognition with Python 2.7 and OpenCV 3.2 to detect cars moving in and out of a parking lot.

Links to other repositories which tie in with this project:

ParkingLotTrackerServer

ParkingLotTrackerMobileApp

Version: 0.5.1

Table of Contents

Getting Started

Clone down the project in the manner that you prefer, example from terminal:

$ git clone https://github.com/Archheretic/ParkingLotTracker .git

If your interested in contributing to the project look at Contributing

Prerequisites

While it is a prerequisite to own a raspberry pi with an official pi camera to be able to run the CarTrackerStream natively, it is not a prerequisite to if you want to test it or develop yourself inside of a docker container. However, you will need to use a video-clip or find another way to stream video to the application.

Installing

To try this project for yourself, you have two options:

Native

If you have a raspberry pi with an attached camera module a debian-based OS (alpine, raspbian jessie to name a few): Compile OpenCV3.2 for python 2.7 yourself following the instructions found here

Use pip to get packages for with NumPy, Request and PiCamera

pip install NumPy Request PiCamera

Run CarTrackerStream.py with python 2.7 from where you cloned the project with the following command: python CarTrackerStream.py

Docker

If you do not have a raspberry pi with an attached camera module but would like to test/develop in docker:

Due to time constraints, we do not have our own docker image available. In the mean time you can use this image.

Install Docker on your machine.

Pull docker image with the following command:

docker pull rickryan/rpi-jessie-opencv3.2

How to run

Running Natively

Run the following command to run the program:

python CarTrackerStream.py

This project should be able to run natively on a Raspberry Pi with a Pi Camera module. The way it is currently designed, it will only work if the camera is placed such that cars that travel upwards are moving in to a parking lot and cars that are moving down are leaving the parking lot. These values are easily changed, if these need to be reversed, but more heavy modifications would need to be made if the tracking would be horizontal or diagonal as opposed to vertical.

Running in Docker

Before we run the docker image, we must first connect xhost with docker to ensure that we can see the images produced.

xhost +local:docker

Run the docker image with the following command:

docker run -ti -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
    -v `pwd`:`pwd` -w `pwd` \
    rickryan/rpi-jessie-opencv3.2:latest

With the docker image running, navigate to where you cloned your project and enter the following command:

python CarTrackerVideo.py

This should run the program and display the video output generated by OpenCV to your screen.

When you are done using the docker container it is a good idea to close xhost:

xhost -local:docker

Contributing

This project welcomes contributions from the community. Contributions are accepted using GitHub pull requests. If you're not familiar with making GitHub pull requests, please refer to the GitHub documentation "Creating a pull request".

For a good pull request, we ask you provide the following:

  1. Try to include a clear description of your pull request in the description. It should include the basic "what" and "why"s for the request.
  2. The pull request should include tests for the change. A new feature should have tests for the new feature and bug fixes should include a test that fails without the corresponding code change and passes after they are applied.
  3. If the pull request is a new feature, please be sure to include all appropriate documentation additions in the Readme.md file as well.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Thanks to https://github.com/mysqljs/mysql for README inspiration, and a big thanks to the whole open source community that has created the development framework and our dependencies in general.b

About

This project in conjunction with a web camera tracks how many free spots there is on the parking lot. This project should be able to run on a Raspberry Pi or a similar product.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages