https://github.com/lddl/goparking
This project is targeted to detect which parking lot (actually any user defined polygon) are occupied by any object.
https://github.com/lddl/goparking
computer-vision gocv opencv parking-lot vehicle-detection
Last synced: 3 months ago
JSON representation
This project is targeted to detect which parking lot (actually any user defined polygon) are occupied by any object.
- Host: GitHub
- URL: https://github.com/lddl/goparking
- Owner: LdDl
- Created: 2018-08-20T07:49:10.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-30T05:46:49.000Z (about 7 years ago)
- Last Synced: 2025-07-10T21:56:55.252Z (3 months ago)
- Topics: computer-vision, gocv, opencv, parking-lot, vehicle-detection
- Language: Go
- Size: 17.4 MB
- Stars: 11
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# goparking
This project is targeted to detect which parking lot (actually any user defined polygon) are occupied by any object.
It uses good computer vision package GoCV (see https://github.com/hybridgroup/gocv) as bindings to Opencv 3.x (https://github.com/opencv/opencv)## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Support](#support)
- [Thanks](#thanks)## Installation
As it uses GoCV, first of all you have to install it. Please see steps described here https://gocv.io/getting-started/.
If you successfully installed everything (GoCV, OpenCV, OpenCV-contrib), then you good to go. Just install it via `get`:
```go
go get github.com/LdDl/goparking
```## Usage
- Build
Go to $GOPATH/src/LdDl/goparking folder.
Open terminal in that folder and type:
```go
go build main.go
```- Configuration
Open example.json file in main project folder and edit fields to fit your needs.
```js
{
// videoType - type of input. It can be either local file or web-service ("url") or connected camera to your PC ("device")
"videoType": "url",
// videoSource - link to your video. If your videoType is "device", then just provide number of that device: for example "0"
"videoSource": "/datasets/parkinglot_1_480p.mp4",
// imageResizing - parameter to scale your image (for fast proccessing or other needs). In example it is same as input.
"imageResizing": [
854,
480
],
// showImage - display image or not
"showImage": true,
// laplacian - parameter for Laplace Operator (https://en.wikipedia.org/wiki/Laplace_operator)
// Please see https://docs.opencv.org/3.4.0/d5/db5/tutorial_laplace_operator.html
// While playng with "imageResizing" you have to change this parameter too to get good results.
"laplacian": 2.0,
// areas - array of parking lots.
// each area has ID (string) and set of coordinates.
// There are no setMouseCallback() in GoCV package (see https://github.com/hybridgroup/gocv/issues/211),
// so I can not implement good "GUI" for extracting clicked points on image.
// For extracting needed points you need to use some 3-d party applications like Paint (Windows) or KolourPaint (Linux).
"areas": [
{
"id": "1t_lot",
"coords": [
[
368,
329
],
[
410,
328
],
[
437,
350
],
[
387,
353
]
]
}
]
}
```- Run
For Linux:
```cmd
./main -cfg=example.json
```
For Windows:
```cmd
main.exe -cfg=example.json
```
- Enjoy




## Support
If you have troubles please [open an issue](https://github.com/LdDl/goparking/issues/new).
## Thanks
Big thanks to creators and developers of [GoCV](https://gocv.io/) for providing bindings to OpenCV
And thanks to this [project](https://github.com/eladj/detectParking) for algorithm template.