Motion Detection - page 3 - General Discussion and Assistance - CHDK Forum  

Motion Detection

  • 24 Replies
  • 6302 Views
Re: Motion Detection
« Reply #20 on: 02 / December / 2011, 19:46:30 »
Advertisements
Well, it starting to function... It repeats, but not when there's motion.
That means something is triggering the motion detection code.  Try changing the value of parameter "f" to something larger.

Quote
Is it possible to: motion - takes one photo - script continues until there's motion again - takes one photo - script continues until there's motion again, and so on?
I got what you wanted the first time.   And that's exactly what it does when I run the script on either of my cameras.

Try this :
Code: [Select]
--[[
@title Motion Detect
]]

a=6         -- columns to split picture into
b=6         -- rows to split picture into
c=1         -- measure mode (Y,U,V R,G,B) – U=0, Y=1, V=2, R=3, G=4, B=5
d=300000    -- timeout (mSec)
e=200       -- comparison interval (msec) - less than 100 will slow down other CHDK functions
f=5         -- threshold (difference in cell to trigger detection)
g=1         -- draw grid (0=no, 1=yes)   
h=0         -- not used in LUA - in uBasic is the variable that gets loaded with the number of cells with motion detected
i=0         -- region masking mode: 0=no regions, 1=include, 2=exclude
j=0         --      first column
k=0         --      first row
l=0         --      last column
m=0         --      last row
n=0         -- optional parameters  (1=shoot immediate)
o=2         -- pixel step
p=0         -- triggering delay (msec)

repeat
zones = md_detect_motion( a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)

if( zones > 0 ) then
shoot()
end

sleep(4)

until ( false )
« Last Edit: 02 / December / 2011, 19:48:01 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Motion Detection
« Reply #21 on: 02 / December / 2011, 20:05:20 »
I tried again, TV off and imac screen off (light could be interfering) and the result is the same.

Once it takes the first photo, it keeps going and going taking continuous photos, even without Motion. It seems that the repeat is making the camera enter in a cycle of taking shots, instead of repeating or not finishing the script once the first photo is taken.

Re: Motion Detection
« Reply #22 on: 02 / December / 2011, 20:22:17 »
I tried again, TV off and imac screen off (light could be interfering) and the result is the same.

Once it takes the first photo, it keeps going and going taking continuous photos, even without Motion. It seems that the repeat is making the camera enter in a cycle of taking shots, instead of repeating or not finishing the script once the first photo is taken.

And I tested again on my cameras.  The script works.

Did you change the sensitivity parameter in the file as I suggested ?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online philmoz

  • *****
  • 3332
    • Photos
Re: Motion Detection
« Reply #23 on: 02 / December / 2011, 20:52:44 »
I tried again, TV off and imac screen off (light could be interfering) and the result is the same.

Once it takes the first photo, it keeps going and going taking continuous photos, even without Motion. It seems that the repeat is making the camera enter in a cycle of taking shots, instead of repeating or not finishing the script once the first photo is taken.

If the camera has a 'Continuous AF' setting in the Canon menu then make sure it is turned off.

On the G12 and SX40 the 'p' value has to be at least 500 for the motion detect to work properly.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


Re: Motion Detection
« Reply #24 on: 06 / December / 2011, 18:00:03 »
Hello  again.

Finally I got it!

I changed the values of p and f, and also changed one important detail in menu: print was in auto and i changed to a symbol that may be something not auto :D and it finally disabled the continuous shooting.

Tomorrow I'll test it as a spy cam to fauna!

Thank you all!

 

Related Topics