Grades calculator for the BSc Computer Science at the University of London
Project description
OpenCV2 Object Counter
Count objects using opencv2 in this configurable CLI utility. The module uses frame differencing to detect and count objects according to a flexible configuration scheme. This makes it a quick-and-dirty solution that can achieve good accuracy in a variety of cases and doesn't involve the computaional overhead nor complexity of convolutional neural netowrks (CNN).
Alternatively, the package can be imported to your own scripts.
Gates
Gates
are the instrument used for counting. They are boxes which detect objects passing through them. A cooldown is triggered when it detects an object to avoid counting the same object many times. The right cooldown duration will depend on the counting situation. An object is counted if the gate is not on cooldown and the center point of the object and the gate is within the given distance.
Configuration
Here is an annotated example config. A default config is provided in ooc/config.json
. Running ooc
in cli mode requires a config. More details on some of the parameters can be found on https://docs.opencv.org/
.
{
// list of gates that will be used for counting
"gates": [
{
// Starting x and y position (0,0 is top left)
// and gate dimnensions
"y": 320,
"width": 100,
"height": 100
}
],
"blur" : {
// openCV2 kernal size
// must be positive or odd, or 0 (in which case
// they are computed from sigma)
"ksize": {
"width": 21,
"height": 21
},
// openCV2 kernal standard deviation
"sigma_x": 0
},
// whether or not the video shows. press 'q' to quit
"show": true,
// whether or not additional video shows/logs print
"debug": false
}
Development
Run pytest
in root of package to run tests.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for opencv-object-counter-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4a3d837527c9ce7087bf8a1e66cbe2deac95cbd7048d9956394e3d8603367f5 |
|
MD5 | 73978589faa813610d5e5a1ba24e3cea |
|
BLAKE2b-256 | 3b53c72b987bbeb618d0732c88235862aa2ae0093624973bcfa792ff84b62d97 |
Hashes for opencv_object_counter-0.1.0-py3.9.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2659d1975dd0e33ef1298291a3a697fecd4a655ce37458ac498613dfd03c251 |
|
MD5 | fbd9a0c0fb4e6018fc033ac290a42b36 |
|
BLAKE2b-256 | 3ecc9fd501fcc92a167f4dd0c4a18e6b695402be0defb71de784011ae6242507 |
Hashes for opencv_object_counter-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6b8e213aa5572362bfd0c98b31c3c44ce043e0f2c937d3d036a4b5cff8123f6 |
|
MD5 | f5d712d82b660fac14c0c7a75051f233 |
|
BLAKE2b-256 | 4e50b3a0a9cfc453b9fdbdf645f3bf560038ac2d0ded7e80b56d55386d6f20b5 |