Update: I updated the links in this first post to the latest version of Motion Detect Plus 0.3.1
I created a CHDK motion detection script called "Motion Detect Plus" to take repetitive shots with motion detection.
This Motion Detect Plus script adds a repetitive shot feature to the standard CHDK "motion.lua" script. This is useful for creating a motion time-lapse sequence using motion detection to trigger the photos instead of a traditional intervalometer.
DownloadYou can
download the CHDK Motion Detect Plus script here.
Development BlogI created a
page for the Motion Detect Plus script on my blog to track the development of this script.
Version HistoryVersion 0.3.1
Created Sept 16, 2012
Changed the zones variable to avoid a naming conflict.
Added a "Number of Shots" variable that takes a burst of photos
during a motion detection event.
Version 0.3
Created August 20, 2012
Improved the motion threshold settings.
Version 0.2
Created June 25, 2012
Added a "Motion Threshold" parameter
Version 0.1
Created on Feb 26, 2012
Initial Release of Motion Detect Plus
Script ControlsThere are several settings that can be set in the CHDK Script preferences:
This upgrade adds a "Motion Threshold" parameter that lets you control the responsiveness of the motion detection feature. If the camera takes photos continuously increase the "Motion Threshold" setting for a reduced motion detection response.
Here are several typical motion threshold levels:
12=Sun 24=Cloudy 36=Dawn/Dusk
You can set a start delay in minutes and seconds. This gives you time to set up your shot before the motion detection is enabled.
The "Number of Shots" variable takes a burst of photos during a motion detection event. This gives you a better chance of catching interesting photos when the motion detection trigger is set off.
The hollow boxes onscreen are the detection grid. You can choose to show or hide the detection grid.
You can set up a detection grid by defining the number of Grid Columns and Grid Rows. Once the grid is defined you can enable specific cells in the detection grid by specifying the Start Column / End Column and Start Row / End Row values.
The region value controls the motion detection masking zones. The region value can then be set to either:
0 = No (disable regions)
1 = In (The area inside the start / end region is the detection zone)
2 = Out (The area outside the start / end region is the detection zone).
Script Installation1. Copy the motionp.lua script to the CHDK scripts folder on your SD memory card.
2. Start CHDK and from the ALT Menu open the "Scripting Parameters" Menu. In the script window select the "Load Script from File..." menu option. Then in the "Select Script File" window select the MOTIONP.LUA script and press the Func. Set button to load the script.
3. Set the script parameters for Motion Detect Plus and define your motion detection grid size, and masking region settings.
4. Exit the CHDK Menus and start the Motion Detect Plus script by pressing the shutter button when the text ALT is displayed on screen. If you enabled a Start Delay period the camera will play a short beeping noise to indicate when the start delay period is over.
The grey rectangles on the LCD screen show the active motion detection regions. If motion occurs within one of the selected rectangles a new photo will be taken.
The script will display a counter showing how many photos have been taken since the script was started.
The Motion Detect Plus photo counter looks like this:
3 Shots Taken
Motion Detect Plus <ALT>
5. You can stop the script at any point by pressing the shutter button.
NoteThere appears to be an issue where the motion detection function doesn't reset for the next photo unless the image review mode is disabled. To disable the image review feature, open the main Canon menu by pressing the menu button on your camera. Scroll down to the option labeled
Review and set it to
Off.
Controlling the Detection RegionsThe Motion Detect Plus script allows you to create any type of grid layout you desire in the scripting parameters window. Non-uniform grids layouts are also supported such as a 12x10 layout.
In this demonstration I will present a few of the more common motion detection grid arrangements possible with the Motion Detect Plus script. For this example I am using a 3x3 grid layout with 3 columns, and 3 rows.
An illustration of motion detection regions.
To enable every block on the gridRegion:0 (No)
This will set the whole screen to be active for motion detection.
In this illustration all of the grid regions are enabled.
To enable just the center blockRegion: In
Start Column: 2
End Column: 2
Start Row: 2
End Row: 2
In this illustration the center region is enabled.
To enable the center and center-right blocks chooseRegion: In
Start Column: 2
End Column: 3
Start Row: 2
End Row: 2
In this illustration the center and center-right regions are enabled.
To enable a lower corner 2x2 block section chooseRegion: In
Start Column: 2
End Column: 3
Start Row: 2
End Row: 3
In this illustration a square region on the lower right is enabled.
To enable a vertical column on the right side chooseRegion: In
Start Column: 3
End Column: 3
Start Row: 1
End Row: 3
In this illustration a vertical column region on the right side is enabled.
To enable the top two rows chooseRegion: In
Start Column: 1
End Column: 3
Start Row: 1
End Row: 2
In this illustration a double rows region at the top is enabled.
To enable a vertical column on the left side chooseRegion: In
Start Column: 1
End Column: 1
Start Row: 1
End Row: 3
Bonus TipWith the region set to 2 (Out) the motion detection script will exclude motion from the active grid box. This allows you to define the unselected areas as the place where motion will be detected.