Turn web cam into a black / white board. Improved version of cam_board.
Turn web cam into a black / white board:
This is an improved version of cam_board.
If you are familiar with git and python 3 then
make sure you have the numpy
, opencv-python
and opencv-contrib-python
libraries installed before cloning the repository.
The main script is betterCamera
.
The program can be launched from the terminal:
$ betterCamera
Control is via keyboard shortcuts. A list of special keys
is available by pressing h
. To quit the program hit q
:
Printouts with the ARUCO markers for a 16x9 camera aspect ration are available (the circle marks the top left corner of the page):
Printouts for other aspect ratios can be prepared using this, this, this, and this SVG image. Just make sure they are appropriately oriented on the page and that the innermost rectangle formed by the ARUCO marker corners has the correct aspect ratio.
All ARUCO symbols were generated using this handy website.
This is important 😀 Just hit q
.
The h
key activates the help screen:
with a description of all the special keys.
Hitting w
just displays the camera picure directly:
Two keys can be used to achieve this, r
and t
:
Small movements of the camera might cause jitter when using t
.
Pressing r
will additionally smooth out the image and introduce a
small time delay.
Two keys can be used to achieve this, y
and u
:
Small movements of the camera might cause jitter when using u
.
Pressing y
will additionally smooth out the image and introduce a
small time delay.
This can be useful for saving slide presentations.
Two keys can be used to achieve this, d
and f
:
Small movements of the camera might cause jitter when using f
.
Pressing d
will additionally smooth out the image and introduce a
small time delay.
Two keys can be used to achieve this, i
and o
:
Small movements of the camera might cause jitter when using o
.
Pressing i
will additionally smooth out the image and introduce a
small time delay.
When using d
, f
, i
or o
it might be helpful to adjust
the de-noising parameter used to remove the background. This
can be achieved by pressing +
or -
.
This requires information on additional cameras inside the configuration file. See the next section for more information no how to do this.
With the configuration file appropriately edited
hit n
to use the next camera. If the camera is not available a still
image will be displayed. The n
key can be hit many times and will loop through
the cameras.
To add additional cameras, change camera resolutions, etc. edit the configuration
file.
The path to a directory containing the configuration file betterCam_config
is
displayed at the very bottom of the window
after pressing the h
key:
All configuration is done by modifying this file.
Don’t be afraid to tinker with the settings, if you mess up, just replace betterCam_config
with the default configuration file.
Configuration settings are entered using a simple key = value
syntax. For example, the
number of buffered perspective matrices, buffer
can be decreased from the default 20
to 10 by changing:
buffer = 20
to
buffer=10
Each configuration
option is paired with a comment describing the setting.
Comments are lines starting with #
.
Additionally,
sections are marked using square brackets, for example [perspectiveMatrix]
.