CHDK Wiki

Editing

UBASIC/TutorialScratchpad

1
  • The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit. If you are undoing an edit that is …
Latest revision Your text
Line 1,133: Line 1,133:
   
 
====md_get_cell_diff====
 
====md_get_cell_diff====
A function used to determine where on a scene actually detection happened. This procedure is designed for scene change advanced analysis. 
+
[mx3]it is optional procedure for those people who want to know where on scene actually detection happened. this procedure is designed for scene change advanced analysis.
  +
I'm not sure many people will need to use it.
  +
most people will need to use "h" variable from above sample to trigger shoot. (feel free to rephrase)[/mx3]
   
 
:Usage: md_get_cell_diff (column), (row), x<br /><br />
 
:Usage: md_get_cell_diff (column), (row), x<br /><br />
:where x will be difference of 0 to 255 between the last and present change in that cell. Triggering a script to shoot on this value may be done by detecting no change, or how much sensitivity you would like to detect in that cell.<br /><br />
+
:Where x will be difference of 0 to 255 between the last and present change in that cell. Triggering a script to shoot on this value may be done by detecting no change, or how much sensitivity you would like to detect in that cell.<br /><br />
 
:Examples:
 
:Examples:
 
:If you would like to have the camera shoot an image when all motion stops, use:
 
:If you would like to have the camera shoot an image when all motion stops, use:
Line 1,182: Line 1,182:
 
(If values less than zero are entered or if total number of cells is greater than 1024, it defaults to 3 x 3.)
 
(If values less than zero are entered or if total number of cells is greater than 1024, it defaults to 3 x 3.)
   
Parameter 'g' determines if the grid showing the detected cells is displayed (0=no, 1=grid, 2=sensitivity readout, 3=sensitivity readout & grid)
+
Parameter 'g' determines if the grid showing the detected cells is displayed.
   
 
Parameters 'j,k,l,m' define a sub-area of the screen where motion-detection is restricted-to or excluded-from.
 
Parameters 'j,k,l,m' define a sub-area of the screen where motion-detection is restricted-to or excluded-from.
Line 1,230: Line 1,230:
 
threshold, // input parameter. difference value for which procedure will trigger detection of changes
 
threshold, // input parameter. difference value for which procedure will trigger detection of changes
   
draw_grid, //  input parameter.
+
draw_grid, // boolean input parameter.
// (0=no, 1=grid, 2=sensitivity readout, 3=sensitivity readout & grid)
+
// true(1) to draw grid(detected sectors/cells).
  +
// false(0) - to not display grid/detected sectors
   
 
detected_cells_count, // output parameter. count of cells where pixel values differs enough to trigger motion detection
 
detected_cells_count, // output parameter. count of cells where pixel values differs enough to trigger motion detection
  Loading editor
Below are some commonly used wiki markup codes. Simply click on what you want to use and it will appear in the edit box above.

View this template