Motion Detection too slow? - page 3 - Script Writing - CHDK Forum supplierdeeply

Motion Detection too slow?

  • 253 Replies
  • 187814 Views
Re: Motion Detection too slow?
« Reply #20 on: 01 / February / 2008, 07:03:57 »
Advertisements
Deleted
« Last Edit: 22 / April / 2008, 10:17:17 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

Re: Motion Detection too slow?
« Reply #21 on: 01 / February / 2008, 07:44:06 »
Here is the program. It's a bit cheesy but it has helped me.

"Trigger interval" is the interval between consecutive triggering.
"Trigger flash time" is how many ms to flash the trigger on screen (maybe useful but not sure :) )
"Timing step" is the number of milliseconds for each bar drawn.

The program is hard coded to take 2 seconds from left to right but that should be enough for testing.
It may not work on everyones pc, but I did code it in a vmware machine and it works fine in that and on my host dual core system. And the lines and bars don't usually line up perfectly since the bar location is calculated just before drawing, whereas the grid is computed once and is just a guide.

I think I'm going to puke... :blink:

I'll have to see how my cameras respond.

-tgq

Re: Motion Detection too slow?
« Reply #22 on: 01 / February / 2008, 08:20:32 »
Deleted
« Last Edit: 22 / April / 2008, 10:17:37 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

*

Offline BB

  • ***
  • 164
Re: Motion Detection too slow?
« Reply #23 on: 01 / February / 2008, 12:20:35 »
I am sure everyone here knows more than I--but from many decades ago working with computers built from sticks and stones that ran basic interpreters... Those interpreters would, after executing a line of code, would jump back to the first line of code and scan back down towards the end to find the next line to execute.

If we wanted the basic code to run quickly, we put the time sensitive routines at the beginning (jumps, gosubs, etc.) where they would execute the quickest. And run the rest of the code (setup, housekeeping, etc.) at the "end of the program" where it was not time sensitive.

I don't know anything about this basic interpreter... Your mileage may vary...  :-X

-Bill


Re: Motion Detection too slow?
« Reply #24 on: 01 / February / 2008, 14:42:44 »
I was also getting slow response from my S2 when running the motion detection script. I noticed that even when the camera is in M mode and the focus, shutter speed and aperture are locked, the camera still meters the light to display the recommended exposure compensation. That's why I put a press "shoot_half" in the script mx3 posted in this thread and now it takes the shot immediately after something moves in front of the lens. This scripting stuff is pretty new to me so I didn't exactly know where to put the shoot_half. I put it here:

click "shoot_full"
rem sleep 10
rem release "shoot_full"
press "shoot_half"

:zzz

next z

end

The first shot is still slow is this case but all the others are fast.

Re: Motion Detection too slow?
« Reply #25 on: 01 / February / 2008, 15:47:18 »
Chem, I was actually thinking of putting the "shoot_half" but wasn't sure if it would work properly. Glad to know it does. Will try on my A610 and see how much faster it is.

Any ideas to improve the test program? It evolved very rapidly in the few hours I worked on it :)
But it could be improved a little.  The timing may not be perfectly accurate (out by 20ms or so). I wanted to add time values to the grid so you didn't have to count :)

Re: Motion Detection too slow?
« Reply #26 on: 01 / February / 2008, 16:39:16 »
Barney, I don't think tweaking the detection code will help. If you use a testing option (mx3 showed how several posts ago) even my A610 gets a 10ms response time. The code is fast enough. It's whatever the camera does internally before opening the shutter that slows all this down.

I just tried several more settings with my camera.
First, adding a "shoot_half" command doesn't seem to help. And I guess it shouldn't since I have everything on manual and "shoot_full" is meant to take a shot whether the camera has focused or not.

Secondly it seems the A610 is fastest in shutter priority mode rather than full manual. This may be because it allows you to use AE lock and that may speed things up.

But still, I can't get much less than 1/2 a second response. It's a real shame because the motion detection code is fast enough you could use it to trigger water drop exposures. But the cameras themselves are letting us down.

BTW, I was looking at buying an S3 in the next couple of days hoping it would be faster for this. Unfortunately they are rare here now, and some of you have shown they're not much faster anyway. PLEASE!!! work out the S5 firmware people :)

Re: Motion Detection too slow?
« Reply #27 on: 01 / February / 2008, 17:28:49 »
Deleted
« Last Edit: 22 / April / 2008, 10:18:05 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye


Re: Motion Detection too slow?
« Reply #28 on: 01 / February / 2008, 18:22:15 »
Quote
Would it be possible to include just one more option/variable in the MD command, that would trip the shutter directly instead of having to depend on a small script loop for that? This could shave off another 30-50ms as those lines are being executed.

AFAIK, it already has an option (option 'n') to make an immediate shoot. However I've read here somewhere that it's actually slower than doing it with a script. I don't know if Allbest optimized that part of the code yet. Looking at the source code, I can't see why it would be slower.

Re: Motion Detection too slow?
« Reply #29 on: 01 / February / 2008, 18:26:59 »
Deleted
« Last Edit: 22 / April / 2008, 10:18:27 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

 

Related Topics