YvesG
Posts: 46
Joined: Wed Oct 03, 2012 6:54 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 08, 2015 5:27 pm

A better paper1.png?
I tried to find a better background that the current one named paper1.png and find nothing until now that suit well.
The current one make me think to the early beginning of netscape :-)

Any suggestion?

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 08, 2015 8:59 pm

I've got a new media.php up with prev/next select buttons and configurable columns and namesize.
git pull origin, or as before:

Code: Select all

wget https://raw.githubusercontent.com/billw2/pikrellcam/master/www/media.php
To get a short name display, I parse the video/still name to extract the time and this can be
confused if there is a custom video_filename format. I could use the file mtime, but then
the generated short file name time would not agree with the full file name time since the full
file name time is the motion detect start time. There is a fall back to the mtime name if a simple
parse of the file name fails, but it's far from fail safe! This is a heads up if you have edited the
video_filename format and in hindsight I should have had more strict requirements on changes
to that. I may have to retroactively require some constraints on the format.
This issue shows up on the thumbs page where the time displayed on the web page is not the
same as the time embedded in the file name (it's off by approximately the seconds length of the video).

YvesG
Posts: 46
Joined: Wed Oct 03, 2012 6:54 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Aug 09, 2015 8:53 am

I like this wallpaper http://invaderjohn.deviantart.com/art/V ... s-97008841 simple and make the UI easy to read.
it give PiKrellCam a new look
What do you think?

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Aug 09, 2015 2:17 pm

YvesG wrote:I like this wallpaper http://invaderjohn.deviantart.com/art/V ... s-97008841 simple and make the UI easy to read.
it give PiKrellCam a new look
What do you think?
It does have a good look and I'll add it as a background option to the pikrellcam distribution.
But first I need to set things up so that users can add backgrounds to their local git repo
without getting out of sync with git origin.

monty_burns_007
Posts: 7
Joined: Sun Dec 08, 2013 6:44 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Aug 10, 2015 7:43 am

Does anyone else notice that the PiKrellCam gives darker timelapse/pictures than simple raspistill captures ?

I have 2 pi's next to each other capturing timelapse pictures.
1 with a simple sh script (running once per minute through cron):

#!/bin/bash

DATE=$(date +"%Y-%m-%d_%H%M")
raspistill -w 1280 -h 720 -q 80 -n -e jpg -th none -o /home/pi/timelapse/$DATE.jpg


and 1 with PikrellCam timelapse use. (running once per minute)

Resolution settings are the same (1280x720). I didn't change any default Pikrell settings, so they look the same as the default RaspiStill settings.

Is that because Pikrell is also running as a continuous video stream (webcam page) ?
Can I change any PiKrell settings so my timelapse picture are as clear as the raspistill pictures ?
Or perhaps is it possible to disable the continous video mode (camera always on off), and let the webpage display the last made timelapse image ?

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Aug 10, 2015 2:51 pm

monty_burns_007 wrote:Does anyone else notice that the PiKrellCam gives darker timelapse/pictures than simple raspistill captures ?
...
Is that because Pikrell is also running as a continuous video stream (webcam page) ?
Can I change any PiKrell settings so my timelapse picture are as clear as the raspistill pictures ?
Or perhaps is it possible to disable the continous video mode (camera always on off), and let the webpage display the last made timelapse image ?
When it mode switches from video capture to still capture the camera does seem to settle differently,
I see that the still brightness is modulated some by the video frame rate and I get different jpg light
levels depending on how I run raspistill (try -t 100 and -t 1000).
A setting that can make the pikrellcam still closer to your raspistill use is exposure compensation.
Try setting it to about +3.

YvesG
Posts: 46
Joined: Wed Oct 03, 2012 6:54 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Aug 10, 2015 9:00 pm

billw wrote:
YvesG wrote:I like this wallpaper http://invaderjohn.deviantart.com/art/V ... s-97008841 simple and make the UI easy to read.
it give PiKrellCam a new look
What do you think?
It does have a good look and I'll add it as a background option to the pikrellcam distribution.
But first I need to set things up so that users can add backgrounds to their local git repo
without getting out of sync with git origin.
No worries, it's just an idea to make the UI look a bit more attractive :-)

boomlikethat
Posts: 85
Joined: Sun Aug 03, 2014 10:32 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Aug 10, 2015 9:23 pm

billw wrote:I've got a new media.php up with prev/next select buttons and configurable columns and namesize.
git pull origin, or as before:

Code: Select all

wget https://raw.githubusercontent.com/billw2/pikrellcam/master/www/media.php
To get a short name display, I parse the video/still name to extract the time and this can be
confused if there is a custom video_filename format. I could use the file mtime, but then
the generated short file name time would not agree with the full file name time since the full
file name time is the motion detect start time. There is a fall back to the mtime name if a simple
parse of the file name fails, but it's far from fail safe! This is a heads up if you have edited the
video_filename format and in hindsight I should have had more strict requirements on changes
to that. I may have to retroactively require some constraints on the format.
This issue shows up on the thumbs page where the time displayed on the web page is not the
same as the time embedded in the file name (it's off by approximately the seconds length of the video).
@billw,

Nice job on the updates, much easier to navigate (at least for me). Please keep us up-to-date on the possibility of retroactively constraining filename formats. I'm trying to keep the ordering by date, and the preceding image number can throw the file order off if KrellCam is Stop/Started.

Thanks!

monty_burns_007
Posts: 7
Joined: Sun Dec 08, 2013 6:44 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Aug 11, 2015 7:19 am

billw wrote:
monty_burns_007 wrote:Does anyone else notice that the PiKrellCam gives darker timelapse/pictures than simple raspistill captures ?
...
Is that because Pikrell is also running as a continuous video stream (webcam page) ?
Can I change any PiKrell settings so my timelapse picture are as clear as the raspistill pictures ?
Or perhaps is it possible to disable the continous video mode (camera always on off), and let the webpage display the last made timelapse image ?
When it mode switches from video capture to still capture the camera does seem to settle differently,
I see that the still brightness is modulated some by the video frame rate and I get different jpg light
levels depending on how I run raspistill (try -t 100 and -t 1000).
A setting that can make the pikrellcam still closer to your raspistill use is exposure compensation.
Try setting it to about +3.
I tried the exposure compensation and it works for making the image clearer/brighter.
With a compensation of +5 to +8 I get around the same brightness on PikrillCam as with raspistill.
BUT the capture images on PikrillCam are less sharp than the images made by raspistill.

Both Pi's are pointed to the same subject, same distance.
Maybe there is a difference in the 2 Pi Cam's fixed focus. (hardware)
On top of both official Pi Cam's I've put the same wide angle lense. (pinch attached lense)

I'll try again on the same Pi both image captures to see if this slighty blurred unsharp capture is also unsharp with rapistill.
If it's not, the unsharper PikrillCam picture is related to PiKrillCam's capture method. (video mode)

As you said the camera is reacting/settling differently: video mode <=> still picture mode ?
Maybe that settling is also different for the sharpness of the picture.

It seems to me that a still picture (like with a photo camera) can have a longer exposure time (shutter speed) to allow more light on the sensor and make a more brighter/sharper image.
If the sensor has to work as a video camera, the exposure time is much less (smaller shutter speed), so less light is allowed on the sensor and the picture becomes automatically more blurred/unsharp/darker.

Maybe I can compare the quality/sharpness of PiKrillCam pictures as a recorded video which you pause and make a still of some frame. If you do that with a normal digital camera, these frame still are less sharp than normal focussed manual photo stills.

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Aug 11, 2015 1:54 pm

It is certainly true that video mode frame captures are not as good as stills mode capture. You also see that with other software that lets you choose between the modes. Unfortunately there is no option besides video mode, if you want to take more than about 2 frames per second.

KenR
Posts: 1
Joined: Wed Aug 12, 2015 5:01 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Aug 12, 2015 5:38 pm

This is a nicely executed piece of software, thank you for sharing. I do have one issue though.

I currently run a homespun motion detection program which uses changed pixel counts which is
of course subject to the 'passing clouds on a sunny day' problem. It does however allow me to set
different 'motion' detection thresholds for different regions of the image.

For instance my farmyard has two entrances, one on each side of a large outbuilding and
about 40 metres from the camera so I set the threshold for those two areas very low
(a person in those areas only occupies a few pixels).
For the rest of the image I have a much higher threshold as more pixels are involved.
The program scans one region per cycle and works very well except for the above limitation.

My request is, if possible, to implement individual vector counts and and magnitudes on a
region-by-region basis so that users can tune the detection to suit the areas being monitored.

Regards and thanks again for your program.
KenR

HeikoG
Posts: 12
Joined: Wed Oct 16, 2013 11:53 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Aug 12, 2015 5:56 pm

I just installed pikrellcam from git on a new pi. Everthing is fine except pikrellcam is generating no thumbs. Videos are ok.
Any idea?

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Aug 12, 2015 6:17 pm

HeikoG wrote:I just installed pikrellcam from git on a new pi. Everthing is fine except pikrellcam is generating no thumbs. Videos are ok.
Any idea?
Check that you have the "convert" command. It is in the imagemagick package which the pikrellcam
install is supposed to install, but maybe something went wrong.
After that, check for a convert line in the log (/tmp/pikrellcam.log).
If all of that looks OK, then stop pikrellcam from the web page and run it from a terminal so that
you can see all error messages.

boomlikethat
Posts: 85
Joined: Sun Aug 03, 2014 10:32 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Aug 12, 2015 7:49 pm

HeikoG wrote:I just installed pikrellcam from git on a new pi. Everthing is fine except pikrellcam is generating no thumbs. Videos are ok.
Any idea?

I had the same problem. If billw's solution doesn't work, try installing imagemagick. I did it form the Terminal.

spikedrba
Posts: 75
Joined: Fri Feb 28, 2014 2:19 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Aug 14, 2015 7:25 pm

fwiw I found that the check in the install script to decide if packages need to be install or not doesn't seem to work reliably:

Code: Select all

[email protected]:~/pikrellcam$ dpkg-query -l php5-fpm
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                          Version             Architecture        Description
+++-=============================-===================-===================-===============================================================
un  php5-fpm                      <none>              <none>              (no description available)
[email protected]:~/pikrellcam$ echo $?
0
[email protected]:~/pikrellcam$ dpkg-query -l whatever-dude
dpkg-query: no packages found matching whatever-dude
[email protected]:~/pikrellcam$ echo $?
1
[email protected]:~/pikrellcam$ dpkg -l | grep php5
ii  php5                         5.6.9+dfsg-0+deb8u1               all          server-side, HTML-embedded scripting language (metapackage)
ii  php5-cgi                     5.6.9+dfsg-0+deb8u1               armhf        server-side, HTML-embedded scripting language (CGI binary)
ii  php5-cli                     5.6.9+dfsg-0+deb8u1               armhf        command-line interpreter for the php5 scripting language
ii  php5-common                  5.6.9+dfsg-0+deb8u1               armhf        Common files for packages built from the php5 source
ii  php5-json                    1.3.6-1                           armhf        JSON module for php5
ii  php5-readline                5.6.9+dfsg-0+deb8u1               armhf        Readline module for php5
As you can see I don't have php5-fpm installed (which is why I couldn't get PKC to work), but dpkg -l still finds it even tho it's in a unconfigured state and so does nothing about it. It's the same for imagemagik btw, which I suspect is why other people are having problems.

Using -s seems more reliable:

Code: Select all

[email protected]:~/pikrellcam$ dpkg-query -s php5-fpm
dpkg-query: package 'php5-fpm' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
[email protected]:~/pikrellcam$ echo $?
1
[email protected]:~/pikrellcam$ dpkg-query -s php5-cgi
Package: php5-cgi
Status: install ok installed
Priority: optional
Section: php
Installed-Size: 15510
...
...
[email protected]:~/pikrellcam$ echo $?
0
after fixing that pkgs were installed and nginx worked (altho I still can't get PiKC to work, process isn't running)

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Aug 14, 2015 8:40 pm

spikedrba wrote:fwiw I found that the check in the install script to decide if packages need to be install or not doesn't seem to work reliably:

As you can see I don't have php5-fpm installed (which is why I couldn't get PKC to work), but dpkg -l still finds it even tho it's in a unconfigured state and so does nothing about it. It's the same for imagemagik btw, which I suspect is why other people are having problems.

Using -s seems more reliable:
Ah, thanks for finding that. I looked at that some more and think I'll go with a more direct test:

Code: Select all

if ! dpkg -s $PACKAGE 2>/dev/null | grep Status | grep -q installed
after fixing that pkgs were installed and nginx worked (altho I still can't get PiKC to work, process isn't running)
The install script does not start pikrellcam. If it doesn't run when when you click the
Setup->Start PiKrellCam button, then run pikrellcam from a terminal to see any errors. If it's another
process using the camera, you will get an error something like: mmal: ... : ENOSPC

spikedrba
Posts: 75
Joined: Fri Feb 28, 2014 2:19 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Aug 14, 2015 9:40 pm

thanks, worked through that, it turned out to be a device permission issue + sudo (I'm running minibian so don't quite have all the ready to go settings of raspbian).

while I'm at it, first lemme do what I should have done in my first post:

THANK YOU, THIS IS AMAZING!

seriously, great job. I've spent a bunch of time trying to implement this in RPiWebCam (they did try to bring motion analysis in house, but never got anywhere useful).

Couple of quick questions hopefully:
- there's a number next to the park count, I can't find in the docs what that is
- I'm confused about motion thresholds. I thought that in the end it boiled down to answering the question: are there cnt vectors of magnitude > mag? if yes start recording (this after all the filtering and smartness you put into it!). But when I have the regions going and a look at the counters often times the numbers are higher than 5/4 (and the overall counter is north of 500), but nothing is recorded so I must not understanding this right. Also I set the confirm_gap to 0, but still, passing across the frame doesn't trigger a recording, I have to hang in there for a couple seconds.

thanks

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Aug 14, 2015 11:46 pm

spikedrba wrote: THANK YOU, THIS IS AMAZING!

seriously, great job. I've spent a bunch of time trying to implement this in RPiWebCam (they did try to bring motion analysis in house, but never got anywhere useful).
And thank you for wasting no time in pointing out that install problem! I was wondering why
imagemagick sometimes was not getting installed.
Couple of quick questions hopefully:
- there's a number next to the park count, I can't find in the docs what that is
Umm, do you mean the spkl count? In case that's so, I'll explain that.
The spkl is the "sparkle" count and the number next to it is an exponential average of the
sparkle count. Sparkle count can flash high with a frame burp or it can steadily grow and then
wane at sunrise/sunset.
The expma smooths the sparkle level and is a number I want to look at under various conditions.
I don't actually use it yet and if I end up not using it I will remove that number from the display.
- I'm confused about motion thresholds. I thought that in the end it boiled down to answering the question: are there cnt vectors of magnitude > mag? if yes start recording (this after all the filtering and smartness you put into it!). But when I have the regions going and a look at the counters often times the numbers are higher than 5/4 (and the overall counter is north of 500), but nothing is recorded so I must not understanding this right. Also I set the confirm_gap to 0, but still, passing across the frame doesn't trigger a recording, I have to hang in there for a couple seconds.
There's two things here:
1) I just tried a test with confirm_gap zero to make sure how it was working and discovered there is
a bug that prevents it from actually getting set to zero. So that might have something to do with
your difficulty, and you seem to be on a roll for uncovering problems! Keep it up I guess... :)
Anyway, I just put up a fix for that so you need to update git.

2) Aside from that, if you mean by "passing across the frame" that you do something like wave
your hand in front of the camera then it's likely there is a high reject count and motion can get
rejected. So if you still have problems after doing a git update, try your test from at least a few
feet away from the camera and keep your eye on the reject count. Reject counts are also high
if the camera moves or vibrates.

spikedrba
Posts: 75
Joined: Fri Feb 28, 2014 2:19 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 15, 2015 12:50 am

billw wrote: Umm, do you mean the spkl count? In case that's so, I'll explain that.
thanks for the explanation, I did read up on sparkle and it makes perfect sense, that's one of the things that was biting me a lot with raspimjpeg. However what I meant is the number next to it.
On the OSD I see:
cnt: X rej: X spkl: X YY.Y

it's the YY.Y that I'm wondering about, which if I hadn't been so lazy I'd looked into the code before asking, sorry about it. It's sparkle_expma that I was confused by, not the sparkle_count.
billw wrote: There's two things here:
1) I just tried a test with confirm_gap zero to make sure how it was working and discovered there is
a bug that prevents it from actually getting set to zero. So that might have something to do with
your difficulty, and you seem to be on a roll for uncovering problems! Keep it up I guess... :)
Anyway, I just put up a fix for that so you need to update git.
looks like that was it, just retested and it's a lot better in terms of catching quick movements across the frame.

Re testing, you betcha, 44 of these puppies are going out in the field soon, so there should be plenty data points coming in shortly. Thanks again for making this possible.
billw wrote: 2) Aside from that, if you mean by "passing across the frame" that you do something like wave
your hand in front of the camera then it's likely there is a high reject count and motion can get
rejected. So if you still have problems after doing a git update, try your test from at least a few
feet away from the camera and keep your eye on the reject count. Reject counts are also high
if the camera moves or vibrates.
you were correct, rej were very high when my hand was relatively close to the camera (a foot or so away). Moving farther out a bit gave me good results and it's perfectly acceptable, it's not going to be a common use case anyway.

all of that considered, I still don't quite understand what's going on with the count and magnitude. My count limit is 4 and I've got the gap thing to 0 and fixed per your last patch and I can see at the bottom of the image the cnt counter often going above 4, but no motion is triggered (and in a sense that's good because nothing is moving, it's just noise). That would suggest that my assumption that when the counter is above the limit set triggers recording, if motion is on, is incorrect.

On another note:
- when you load a region it won't show the boxes until I hit the arrows to cycle over them. this confused me in the beginning as I thought it wasn't working
- I'm not sure what "coarse" is supposed to mean. I know the h264 encoder has coarse motion vectors or "high def" if that's what it means, but I thought only coarse were usable at this point.

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 15, 2015 2:12 am

Interesting, on my Pi's the active region rectangles show up immediately after I hit the "show regions" button at lower right on the main page. What you describe happens when you use the left or right arrow in the "motion regions" tab to select an area, without first hitting the "regions" display button. The "coarse" checkbox relates to whether the Move and Size controls change the motion-detect region boxes by a larger (coarse) amount, or a smaller single-pixel per click.

spikedrba
Posts: 75
Joined: Fri Feb 28, 2014 2:19 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 15, 2015 2:48 am

jbeale wrote:Interesting, on my Pi's the active region rectangles show up immediately after I hit the "show regions" button at lower right on the main page. What you describe happens when you use the left or right arrow in the "motion regions" tab to select an area, without first hitting the "regions" display button.
Right, they do that in my case too. What I'm talking about is that if I just booted the pi and regions arent displayed and I load a saved region no regions are displayed unless I toggle the "show regions" button or click the arrows.
jbeale wrote:The "coarse" checkbox relates to whether the Move and Size controls change the motion-detect region boxes by a larger (coarse) amount, or a smaller single-pixel per click.
I guess I should be looking at the code, but does this actually make a difference? because at least on the surface I would expect that: a) detection gets better for smaller objects, and I see no sign of that b) CPU consumption goes substantially up, which I also don't see (altho I'm experimenting on a pi2 rather than my usual B+ I've deployed raspimjpeg on)

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 15, 2015 2:59 am

spikedrba wrote: all of that considered, I still don't quite understand what's going on with the count and magnitude. My count limit is 4 and I've got the gap thing to 0 and fixed per your last patch and I can see at the bottom of the image the cnt counter often going above 4, but no motion is triggered (and in a sense that's good because nothing is moving, it's just noise). That would suggest that my assumption that when the counter is above the limit set triggers recording, if motion is on, is incorrect.
When the count goes above the count limit, the vectors in the count must also pass density
checks. That is most of the vectors must be concentrated within a detect box whose size is determined
by the count value and this along with the direction filtering is pretty effective for rejecting noise.
Also the count limit must be met within a motion region. If you have broad frame action (say swaying
branches) there can be counts in multiple regions and each of those counts must pass the
count limit, direction filtering, and density checks. The count at the bottom of the preview is
the total for all regions and can be above count limit while counts in individual motion regions
may not exceed the count limit. When a region has vectors meeting the count limit, a separate
draw of the count for that region is drawn at the bottom of the region.
On another note:
- when you load a region it won't show the boxes until I hit the arrows to cycle over them. this confused me in the beginning as I thought it wasn't working
- I'm not sure what "coarse" is supposed to mean. I know the h264 encoder has coarse motion vectors or "high def" if that's what it means, but I thought only coarse were usable at this point.
The three buttons to the bottom right of the preview jpeg toggle the show of information on the
display. So the "Regions" button will toggle the show of the motion regions information. If you
click a select arrow in the "Regions" panel, the show of the regions is forced on. As per your
comment on they are not shown when you load a region, good point and I should also force on
the show when you load a region.

When a region is selected (select with the "<" and ">" arrow keys) its size and position can be edited.
Size and position are coarse adjustable if the "Coarse" button is on. If off, you have fine adjustment which
is by single motion vector and not a single pixel in the preview jpeg. To get the pixel resolution
of fine adjustment of motion regions (if you want it) you need the motion jpeg pixels per motion vector.
For example: at 1920 horizontal resolution, there are 1920/16 = 120 vectors. So motion jpeg pixels
per fine adjustment = mjpeg horizontal res / 120 or 5.33 pixels per vector for a 640 horizontal
resolution mjpeg. This is calculated with floats and the result rounded off to integer pixels which is
why some of the region boundaries may not exactly line up when you move regions around.
So this coarse vs fine has nothing to do with the motion vector configuration inside mmal. That
is always the coarse 16 h264 pixels per motion vector block.

EDIT: Let me add some comments.
1) To summarize, the coarse vs fine motion region adjustment is just for the masking region sizes
and not for motion vectors themselves.
2) From my testing, the value of having a positive confirm_gap is that without it you can get a
motion detect for fast bird flybys a short distance in front of the camera which you may or may
not want. But if you want quicker detection of fast objects you may want the zero
confirm gap. For larger objects I've found I reliably get that second confirming motion detect unless,
as I indicated, it is something very fast. For more reliable detection of very small / far away objects,
you can always reduce the limits. The 5/4 default is not the lowest you can go, although it is close.
I don't advertise going lower because everybody's environment will be different, but I'll just say,
I do run 3/2 sometimes and it is pretty darn sensitive.
3) There is a separate independent test for fast flybys of small objects which is designed to
prevent detects on insects flying by close to the camera and it works very well, but maybe it's
effectiveness could also be reduced by a zero confirm_gap.

spikedrba
Posts: 75
Joined: Fri Feb 28, 2014 2:19 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 15, 2015 8:58 pm

billw wrote: When the count goes above the count limit, the vectors in the count must also pass density
checks.
is the density cont exposed anywhere? Basically where I'm going with this is that I'd love to be able to say "this is what motion looks like on a rainy day", "this is what likes if someone runs across the frame", etc, so that if say I know that running across means a count of 4, I can set the limit to 5 to make sure I catch that.
billw wrote: That is most of the vectors must be concentrated within a detect box whose size is determined
by the count value and this along with the direction filtering is pretty effective for rejecting noise.
Also the count limit must be met within a motion region. If you have broad frame action (say swaying
branches) there can be counts in multiple regions and each of those counts must pass the
count limit, direction filtering, and density checks.
I'm pretty sure I had regions with cnt > 5 and still no recording triggered. That's the reason for my prvevious post.
billw wrote: The count at the bottom of the preview is
the total for all regions and can be above count limit while counts in individual motion regions
may not exceed the count limit. When a region has vectors meeting the count limit, a separate
draw of the count for that region is drawn at the bottom of the region.
see above, pretty sure this was happening and recording was not triggered. Could I dump all values to a file somewhere to double check?
billw wrote: When a region is selected (select with the "<" and ">" arrow keys) its size and position can be edited.
Size and position are coarse adjustable if the "Coarse" button is on. If off, you have fine adjustment which
is by single motion vector and not a single pixel in the preview jpeg. To get the pixel resolution
of fine adjustment of motion regions (if you want it) you need the motion jpeg pixels per motion vector.
For example: at 1920 horizontal resolution, there are 1920/16 = 120 vectors. So motion jpeg pixels
per fine adjustment = mjpeg horizontal res / 120 or 5.33 pixels per vector for a 640 horizontal
resolution mjpeg. This is calculated with floats and the result rounded off to integer pixels which is
why some of the region boundaries may not exactly line up when you move regions around.
So this coarse vs fine has nothing to do with the motion vector configuration inside mmal. That
is always the coarse 16 h264 pixels per motion vector block.

EDIT: Let me add some comments.
1) To summarize, the coarse vs fine motion region adjustment is just for the masking region sizes
and not for motion vectors themselves.
2) From my testing, the value of having a positive confirm_gap is that without it you can get a
motion detect for fast bird flybys a short distance in front of the camera which you may or may
not want. But if you want quicker detection of fast objects you may want the zero
confirm gap. For larger objects I've found I reliably get that second confirming motion detect unless,
as I indicated, it is something very fast. For more reliable detection of very small / far away objects,
you can always reduce the limits. The 5/4 default is not the lowest you can go, although it is close.
I don't advertise going lower because everybody's environment will be different, but I'll just say,
I do run 3/2 sometimes and it is pretty darn sensitive.
makes sense, thank you
billw wrote: 3) There is a separate independent test for fast flybys of small objects which is designed to
prevent detects on insects flying by close to the camera and it works very well, but maybe it's
effectiveness could also be reduced by a zero confirm_gap.
you're the man, seriously! I've spent entire mornings looking at great footage of moths :(. Luckily we have separate IR lights now so it's not too bad, insects tend to go there and leave the actual camera alone.

YvesG
Posts: 46
Joined: Wed Oct 03, 2012 6:54 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Aug 16, 2015 7:28 am

Is it possible to add a button under "system" that do a "git pull origin" to update from UI?

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Aug 16, 2015 3:50 pm

spikedrba wrote: see above, pretty sure this was happening and recording was not triggered. Could I dump all values to a file somewhere to double check?
I'm thinking I need a better user interactive way to do this, but for now you can get a motion debug
dump if you run pikrellcam from a terminal in motion debug mode (quit any web or boot started
pikrellcam first):

Code: Select all

   pikrellcam  -vm
It can be awkward because the output can scroll by pretty fast and so you might need to watch
and then ^C the pikrellcam when you get interesting output to look at. Other than the source
I don't have a doc page for interpreting that output. It's something I could improve but in the
meantime ask if you do this and need clarification on the output.

Return to “Camera board”