Skip to content

Commit

Permalink
moved the diffmap documentation into the docs directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias-Wandel committed Jun 24, 2020
1 parent a1e737f commit b533c55
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 24 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
*.bak
*.obj
*.o
*.exe
*.pdb
*.jpg
.*.swp
./*.jpg
*.swp
browse/*.cgi
2 changes: 1 addition & 1 deletion docs/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h2>Imgcomp options</h2>
Note that the diffmap is scaled down to the detection resolution, so use of the diffmap
may not be accurate to the exact pixel boundary.
<p>
<a href="http://woodgears.ca/imgcomp/diffmap.html">More on diffmaps here</a>
<a href="diffmap.html">More on diffmaps here</a>
<p>
<div class="p">dodir</div>
Specifies which directory full of images to process. This is for off-line mode
Expand Down
186 changes: 186 additions & 0 deletions docs/diffmap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<html>
<head>
<title>Imgcomp: Configuring detection regions</title>
<style type=text/css>
body { font-family: sans-serif; font-size: 100%;}
img { margin-right: 20px; margin-top:0px; margin-bottom:10px; border: 0px;}
img.r { margin-left: 12px; margin-right: 0px; float: right;}
div.th { float:left; width:198px; height:170px;}
div.th img { width: 160; height: 105; margin-right: 12px;
margin-bottom:4px; border-width:1px; border-style:solid; display: block;}

div.c { white-space: pre; font-family: monospace; font-weight: bold; font-size: 120%;}
div.p { white-space: pre; font-family: monospace; font-weight: bold; font-size: 140%; margin-top:10px;}
span.c { font-family: monospace; font-weight: bold; font-size: 120%;}

div.out { white-space: pre; font-family: monospace; font-weight: bold; font-size: 85%;
background-color: black; color: white; line-height: 0.85;
display: inline-block;
border-style: solid; border-color: grey; border-width: 5px; }

</style></head>

<h1>Imgcomp: Configuring detection regions</h1>
When monitoring a scene using a Raspberry Pi and imgcomp, there are often
regions of interest and other regions where motion is not of interest.
Vegetation and flags waving in the wind can trigger motion without
being an event of interest.
<p>

<table align=left cellspacing=0 cellpadding=0><td>
<div class="out">
foo1.jpg - foo0.jpg: 0 at ( 0, 0) (time)
fill 25-256,25-150
clear 128-256,25-75
Weight map: '-' = ignore, '1' = normal, '#' = 2x weight
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------1111111111111111111111111--------------------------------
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
-------111111111111111111111111111111111111111111111111111111111
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------

</div>
<td width=20><td valign=top>
By default, imgcomp will detect motion over the entire image.
<p>
The first way to configure what is of interest is to use the "region" and "exclude"
options.
<p>
The "region" option specifies a rectangle within which detection is to be performed.
Only one region can be specified. However, it's possible to specify areas
to ignore within that region using the "exclude" option. For example, the following
two options would produce an L shaped region of interest in 1024x768 images.
<p>
<div class="c"><p>region = 100-1024,100-600
exclude = 512-1024,100-300</p></div>
<p>
Imgcomp will output an ASCII representation of the happed regions. When operating
on large images (as large as the camera will go), this map will cause line wraps
in each line, so it will messed up unless you use a small font on a large monitor.
<p>
Imgcomp will not output this map until it reads the first image.
Prior to the first image, imgcomp does not know what
size the acquired images are.
<p><br>
Once the first image is read, if images of a different size are encountered,
imgcomp will exit.
</table>
&nbsp;<p>
For more complex regions, specifying individual rectangles to itnore
can be cumbersome. So another option imgcomp has is to read an
image map indicating which parts of the image to ignore.
<p>
<img src="scene.jpg" width=500 height=375>
<img src="diffmap.jpg" width=500 height=375>
<p>
<table align=left cellspacing=0 cellpadding=0><td>
<div class="out">
Weight map (600x450): '-' = ignore, '1' = normal, '#' = 2x weight
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-----------------------------------------------------1111111111111111111111-------------------------
-----------------------------------------------------11111111111111111111111111111111111111111111111
-------------------------------------------------1111111111111111111111##########1111111111111111111
-------------------------------------------------1111111111111111111111##########1111111111111111111
-------------------------------------1111111111111111111111111111111111##########1111111111111111111
-------------------------------------1111111111111111111111111111################1111111111111111111
---------------------------------11111111111111111111111111111111################1111111111111111111
---------------------------------111111111111111111111111################111111111111111111111111111
---------------------------------111111111111111111111111################111111111111111111111111111
111111111111111111111111111111111111111111111111111111111################111111111111111111111111111
111111111111111111111111111111111111111111111111111111111##########111111111111111111111111111111111
111111111111111111111111111111111111111111111111111111111##########111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

</div>
<td width=20><td valign=top>
For the scene above, I want to ignore the bushes because they move with the wind,
the roadway, and the adjoining driveway. So I take an image acquired by
imgcomp and paint those regions to ignore with solid blue. Just for demonstration,
I also coloured a region in solid red to indicate high interest in this region.
Sensitivity in this region will be doubled. The red and blue need to be
fullly saturated colours for imgcomp to use them. For most images you can
just paint red and blue over them without the colors of the image itself triggering
as ignore or double sensitivity.
<p>
On startup, imgcomp outputs a text version of the map, shown at left.
Please note that the weight map dimensions are scaled, typically 1/4 of the image dimensions.
<p>
When using image maps, the image map must be the same dimensions as the images captured
by the camera.
<p><br>
<a href="index.html"><b>Back to Imgcomp main index</b></a>




Binary file added docs/diffmap.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 12 additions & 13 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</style></head>

<b>See also: <a href="config.html">Imgcomp configuration parameters</a>, &nbsp;
<a href="http://woodgears.ca/imgcomp/diffmap.html">Imgcomp detection regions</a></b>
<a href="diffmap.html">Imgcomp detection regions</a></b>
<p>

<h2>What is imgcomp for?</h2>
Expand Down Expand Up @@ -42,7 +42,7 @@ <h2>What imgcomp does not do</h2>
before asking me questions,
get very familiar with linux. This might take you a few months of study.
There is plenty about learning linux on the internet, please don't ask me
for pointers. Sorry, I do not have time to teach you</b>
for pointers. Sorry, I don't have time to teach you</b>

<h2>How imgcomp works</h2>
Imgcomp runs the raspberry pi camera capture program "raspistill" to capture
Expand Down Expand Up @@ -72,20 +72,15 @@ <h2>How imgcomp works</h2>
in parts of an image that are changing a lot over time. This feature is used to avoid
triggering too often on things swaying in the wind.

<h2>Obtaining imgcomp</h2>
You can clone the imgcomp source tree from github using this command
<h2>Obtaining imgcomp and setting it up</h2>
You can clone the imgcomp source tree from github onto your raspberry pi using this command
<p>
&nbsp; <span class="c">git clone https://github.com/Matthias-Wandel/imgcomp</span><p>
<p>

<h2>Compiling imgcomp</h2>
Please see <a href="../setup/setting_up.txt">setting_up.txt</a>
for how to compile and set up imgcomp.
<p>
The setup is broken into two make files for compiling the imgcomp program and the browse
cgi scripts, and several setup scripts for setting up various components.


Please see <a href="../setup/setting_up.txt">imgcomp/setup/setting_up.txt</a>
for how to compile and set up imgcomp. The setup consist of several scripts that
need to be run from the command line.

<h2>How image detection works</h2>
Imgcomp compares successive images. Before doing detection, the images are
Expand Down Expand Up @@ -116,11 +111,15 @@ <h2>How image detection works</h2>
This typically shows up in just one image frame, whereas changes of interest are usually
across several frames. Use the option "spurious=1" in the imgcomp.conf file
to ignore these spurious changes.
<p>
You can also configure the comparison algorithm to ignore certain parts of the image and be
particularly sensitive to other areas. For more on that, please see
<b><a href="diffmap.html">Imgcomp detection regions</a></b>

<hr>
<b>
See also:
<p>
<a href="rtsp_cams.html">How to use imgcomp with RTSP (ONVIF) network cameras</a><p>
<a href="config.html">Imgcomp configuration parameters</a><p>
<a href="http://woodgears.ca/imgcomp/diffmap.html">Imgcomp detection regions</a><p>
<a href="diffmap.html">Imgcomp detection regions</a><p>
Binary file added docs/scene.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions setup/setting_up.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Run setup script that needs to be run as root (sets up apache2, makes ramdisk)
cd ~/imgcomp/setup
sudo ./setup-imgcomp-root

You also need to make sure your camera module is connected, and enabled.
To enable your camera module run "sudo raspi-config" and enable the camera module
under interfacing options. All camera modules supported by the
"raspistill" program are supported by imgcomp.


Now try running imgcomp
cd ~
Expand Down
9 changes: 3 additions & 6 deletions todo.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
To do next:
* Figure out stops on pi zero.
* Make it work for non absolute paths / multiple instances
* Peers server pointers
* Make it work with webcams also.
* Flesh out browser.cfg, use for realtime.
* Peers server pointers (browser.cfg)
* use canvas method instead of chracter graphics for actagrams


Future features:
* Calculate separate motion fatigues for luma and chroma
* Calculate separate motion fatigues for luma and chroma (to better ignore shadows and trees)
* glitch detection for more than one frame?
* Option to not save pre and post event images?
* Image save rate liminting (raise threshold when too many aquired)
Expand Down

0 comments on commit b533c55

Please sign in to comment.