digic 6 motion detection (was Re: SX60HS Porting) - page 5 - General Discussion and Assistance - CHDK Forum  

digic 6 motion detection (was Re: SX60HS Porting)

  • 87 Replies
  • 28261 Views
*

Offline Ant

  • ****
  • 431
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #40 on: 17 / August / 2016, 11:42:13 »
Advertisements
I just compilled motion_detector.c from second page.
Result on my EOS M3:


Not so fast...
« Last Edit: 17 / August / 2016, 11:51:36 by Ant »

*

Offline reyalp

  • ******
  • 12147
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #41 on: 17 / August / 2016, 13:08:32 »
Those results look about what I would expect if you haven't implemented vid_get_viewport_live_fb()

A couple notes
1) md_tune only produces valid results if the AF lamp is the only thing triggering MD. If there is triggering from e.g. garbage in the unused parts of the buffers, noise, other motion in the scene, then the results are meaningless. The junk on the right side of the screenshot suggests this cam may suffer the same false triggering problems as g7x (this may only happen if you do implement vid_get_viewport_live_fb)
2) running chdkptp live view might impact performance, since transferring a frame takes significant time. (it might not though, since it happens in a different task is probably done mostly outside of the main CPU)
Don't forget what the H stands for.

Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #42 on: 17 / August / 2016, 15:41:48 »
I don't think I get double green horizontal grid lines on the sx60.  Wondering where those are coming from.  A mis-scaling of vertical number of rows?

Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #43 on: 17 / August / 2016, 15:43:56 »
I don't think I get double green horizontal grid lines on the sx60.  Wondering where those are coming from.  A mis-scaling of vertical number of rows?


*

Offline Ant

  • ****
  • 431
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #44 on: 17 / August / 2016, 18:07:18 »
I  implemented vid_get_viewport_live_fb()
Now result is better:


But there is a little problem with right column:
« Last Edit: 17 / August / 2016, 18:18:06 by Ant »

Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #45 on: 17 / August / 2016, 23:40:44 »
Quote
But there is a little problem with right column:
A mismatch.  Check X offset maybe?
Probably you are missing some display on the left. Maybe just try zero, if you aren't already...

Code: [Select]
int vid_get_viewport_display_xoffset() {

    int m = mode_get();
    int aspect_ratio=shooting_get_prop(PROPCASE_ASPECT_RATIO);

    if ((m & MODE_MASK) != MODE_PLAY) {
        return (vp_xo[aspect_ratio]);
    }
    else
        return 0;

    return 0;

« Last Edit: 18 / August / 2016, 13:18:54 by 62ndidiot »

*

Offline Ant

  • ****
  • 431
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #46 on: 19 / August / 2016, 10:14:20 »
No. The problem was in difference between buffer width and screen width.
See changes in motion_detector.c:
https://app.assembla.com/spaces/chdk-m3/subversion/commits/13

AFAIK, G7X have the same problem...
« Last Edit: 19 / August / 2016, 10:17:36 by Ant »

*

Offline srsa_4c

  • ******
  • 4023
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #47 on: 19 / August / 2016, 15:20:26 »
The problem was in difference between buffer width and screen width.
Yes and no.
The problem is likely caused by the unused/invisible pixels on the right side of the viewport.
Screen width (camera_screen.width) is a definition belonging to the bitmap overlay, using it in viewport related calculations is not fortunate. Try using vid_get_viewport_width() instead.


*

Offline Ant

  • ****
  • 431
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #48 on: 19 / August / 2016, 17:12:28 »
The problem is likely caused by the unused/invisible pixels on the right side of the viewport.
I now it.
For other aspect ratios and output devices it could be important...

*

Offline reyalp

  • ******
  • 12147
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #49 on: 28 / August / 2016, 02:54:31 »
I've noticed that after I run MD, pressing the power or play button crashes (freezes for a few seconds and shuts down) with the lens out. This happens using test mode (without shooting) in MDFB2013.lua and md_tune.bas.

The error is like
Code: [Select]
ASSERT!! ISDriver.c Line 1835
Occured Time  2016:08:27 21:35:23
Task ID: 17629222
Task name: CtrlSrv
SP: 0x006402CC
...

00017140: UI:Button:0x00001003:PressPBButton
00017140: UI:ex:PB
00017140: UI:USBDisconnect
00017140: UI:ex:PB
00017140: UI:AC:Rec2PB
00017140: UI:ShutdownRecMode
00017140: UI:VTMLock
00017140: UI:VTMUnLock
00017190: UI:Button:0x00001004:UnpressPBButton
00017240: UI:UI_StrobeCon_Stop
00017240: SS:ISChg
Anyone else see anything like this?
Don't forget what the H stands for.