Accessing Motion Detection Actual Values? - page 2 - Script Writing - CHDK Forum  

Accessing Motion Detection Actual Values?

  • 32 Replies
  • 4339 Views
Re: Accessing Motion Detection Actual Values?
« Reply #10 on: 09 / February / 2013, 12:05:35 »
Advertisements
I will incorporate your new call in my birdcam script and give it a good tryout tomorrow. Is there any specific testing you want me to try?
Nothing specific beyond getting it to work in your application without it getting "confused" too often and not recognizing when things get back to the initial state.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline Davo

  • ***
  • 154
Re: Accessing Motion Detection Actual Values?
« Reply #11 on: 10 / February / 2013, 05:13:18 »
One thing I noticed is that locking focus with the Canon AFL seems to confuse motion detection. It returns immediately with a detection when called. I checked it with the Motion.lua stock script and it shows the same behaviour - it just keeps snapping away even with no movement.

I noticed this before on my birdcam script under the 1.0.1 release but I thought it was a fault in my script.

Back to testing

Dave

*

Offline srsa_4c

  • ******
  • 3979
Re: Accessing Motion Detection Actual Values?
« Reply #12 on: 10 / February / 2013, 07:05:33 »
One thing I noticed is that locking focus with the Canon AFL seems to confuse motion detection. It returns immediately with a detection when called. I checked it with the Motion.lua stock script and it shows the same behaviour - it just keeps snapping away even with no movement.
If you activate "zebra" in CHDK, does it look correct when AFL is active?

*

Offline Davo

  • ***
  • 154
Re: Accessing Motion Detection Actual Values?
« Reply #13 on: 10 / February / 2013, 08:03:44 »
Quote
If you activate "zebra" in CHDK, does it look correct when AFL is active?

If I have zebra activated and then turn on AFL, zebra gets switched off in the chdk menu. I can then enable it while AFL is still on.

Zebra seems to work the same with AFL on and off. It shows the bad exposure areas OK but it also displays lines of random red dots and dashes over the top and bottom quarters of the screen. These don't seem to be related to exposure conditions.

Dave


*

Offline srsa_4c

  • ******
  • 3979
Re: Accessing Motion Detection Actual Values?
« Reply #14 on: 10 / February / 2013, 08:19:29 »
If I have zebra activated and then turn on AFL, zebra gets switched off in the chdk menu.
That's a conflicting CHDK shortcut.

Quote
It shows the bad exposure areas OK but it also displays lines of random red dots and dashes over the top and bottom quarters of the screen. These don't seem to be related to exposure conditions.
Do you see the random noise and the correct areas at the same time or are they alternating (move your cam to be sure, of course) ? The random parts are the cause of false motion detection.


@nafraf, in case you're reading this and still have an A810, can you try this scenario in chdkptp? I suspect that there is something going on with the liveview buffer configuration in AF lock.

*

Offline Davo

  • ***
  • 154
Re: Accessing Motion Detection Actual Values?
« Reply #15 on: 10 / February / 2013, 08:36:10 »
Quote
Do you see the random noise and the correct areas at the same time or are they alternating (move your cam to be sure, of course) ? The random parts are the cause of false motion detection.

They alternate at around 2 or 3 fps or thereabouts.

I have CHDKPTP installed and I can get live view to work but I can't work out how to run CHDK within CHDKPTP. If I could I would take a screenshot for you.

Dave

*

Offline srsa_4c

  • ******
  • 3979
Re: Accessing Motion Detection Actual Values?
« Reply #16 on: 10 / February / 2013, 08:53:16 »
They alternate at around 2 or 3 fps or thereabouts.
That means CHDK periodically gets liveview buffer addresses which are not in use when AFL is activated.
Quote
I have CHDKPTP installed and I can get live view to work but I can't work out how to run CHDK within CHDKPTP. If I could I would take a screenshot for you.
The liveview over PTP will help you seeing what the CHDK motion detector gets as source. You won't need to upload it, but you can identify what can be seen on the "wrong" frames (my guess: the scene before AFL activation, with some random noise).

Start chdkptp, connect the camera, switch it to record mode with the chdkptp "rec" button. Now on the camera, press the ALT button several times until the buttons start to work normally. PTP and liveview will still work, and you can use the camera manually.

Re: Accessing Motion Detection Actual Values?
« Reply #17 on: 10 / February / 2013, 09:06:02 »
One thing I noticed is that locking focus with the Canon AFL seems to confuse motion detection.
Did you add set_aflock() to your script instead ?

That's a conflicting CHDK shortcut.
On more reason why having a menu item to disable CHDK shortcuts makes a lot of sense to me.  Having RAW turning on randomly is annoying enough on its own.

Start chdkptp, connect the camera, switch it to record mode with the chdkptp "rec" button. Now on the camera, press the ALT button several times until the buttons start to work normally. PTP and liveview will still work, and you can use the camera manually.
That's basically what I did to produce all the screenshots for the USB Remote V2 wiki page.
« Last Edit: 10 / February / 2013, 09:08:07 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline nafraf

  • *****
  • 1306
Re: Accessing Motion Detection Actual Values?
« Reply #18 on: 10 / February / 2013, 09:14:31 »
I could not see the problem in a810 100d, in my tests Zebra works right with AFL enable/disabled.

@Davo
I compiled a version with shortcuts modified, please use REC button to enable/disable ZEBRA. 

EDIT
A new version with vid_get_viewport_live_fb() implementation using viewport_buffers[] and active_viewport_buffer in attachment.
« Last Edit: 10 / February / 2013, 09:27:51 by nafraf »

*

Offline Davo

  • ***
  • 154
Re: Accessing Motion Detection Actual Values?
« Reply #19 on: 11 / February / 2013, 07:06:10 »
Weird thing - the AFL problem seems to have cleared itself. I set out today to record the random lines using ptp and the zebra is working as expected with AFL on and off - no lines. This was done using the special build that waterwingz gave me at the top of this thread. I didn't change anything overnight so I am stumped. It also works OK with ptp disconnected.

I then tested the stock motion.lua script with AFL on and it also worked as expected.

Still to test the new version that nafraf posted.

Testing is going well on the new function but it sometimes seems to hang instead of recognising the original scene levels. I am going to add a log file to capture the readouts to see where the problem is.


 

Related Topics