CHDK Motion Detect Plus Script

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.

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.

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).

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.

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.

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 Regions

The 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.

Is there a way to adjust sensitivity in motion detect scripts? For example, in those images in the thread with the birds, I can imagine there being a small amount of "natural" change in successive image samples that might be enough to trigger images. I'm talking about something like those trees in the background or the blades of grass in the foreground swaying in the breeze. I would want to have a threshold parameter where you could set how much change in the image is required to make it trigger. Obviously the birds entering would result in a large amount of change, but blades of grass swaying shouldn't.

Also, can these scripts trigger video instead of shooting images? Kind of like a security camera that only records video when something's happening, thereby avoiding video of nothing happening. That would make for "reviewing the security footage" becoming a much less arduous task. I would imagine for the video part, each trigger event (where motion is detected) results in a restart if a 10 second timer. As long as motion keeps happening, that 10 second timer keeps getting restarted. Only once no more motion is being detected would the timer ever get a chance to time out and stop.