I have switched off zebra and histogram
try to use 16 pixel step
NOTE: actually number of cells does not affect speed
using only half of screen will speedup calculation (I think it will be usefull for lightning photography )
oh. I almost forgot
md have built-in performance test module
@title md benchmarks
@param a Columns
@default a 8
@param b Rows
@default b 6
@param c Threshold (0-255)
@default c 10
@param d compare Interval (millisecs)
@default d 0
@param g pix step(speed/accuracy adj)
@default g 8
@param h reg mode(0-no,1-incl,2-excl)
@default h 2
@param e Top Rows
@default e 1
@param i 0-U,1-Y,2-V,3-R,4-G,5-B
@default i 1
@param f bench time (seconds)
@default f 120
let f=f*1000
md_detect_motion a, b, i, f, d, 0, 1, t, h, 1, 1, a, e, 10, g, f
end
this code will produce file in the root directory: MD_INFO.TXT
here is my file:
--- 2008-01-30 15:09:34
CHDK Ver: allbest [ #16 ]
Build Date: Dec 29 2007 14:18:21
Camera: a630 [ 100c ]
[8x6], threshold: 0, interval: 0, pixels step: 8
region: [1,1-8,1], region type: 0
wait interval: 120000, parameters: 10, calls: 11809, detected cells: 0
- - 52360
[1] - 52370
[2] - 52380
[3] - 52390
[4] - 52400
[5] - 52410
[6] - 52420
[7] - 52430
[8] - 52440
[9] - 52450
[10] - 52460
[11] - 52470
[12] - 52480
[13] - 52490
[14] - 52500
[15] - 52510
[16] - 52520
[17] - 52530
[18] - 52540
[19] - 52550
[20] - 52560
[skipped]
explanation:
detected cells: 0 - does not matter
threshold - does not matter in benchmarking (oops. some more bug. i used 10. don't worry. it is error of log function)
pixels step: 8 - actually used not every 8th pixel but 8*8=64 (this step applyed to X and Y coordinates)
region type: 0 - full grid was used for calculation
wait interval: 120000 - 120 seconds where used for benchmarking ( 10 seconds enough really :-) )
parameters: 10 - it seems it is incorrect value (sorry. some bug :-) )
calls: 11809 - that is count of comparisons have been made during benchmarking
as we can see every 10 mseconds md code did it's work without processor overloading
also following values are time in milliseconds
- - 52360
[1] - 52370
[2] - 52380
time difference between calls ( CHDK code calls md routine when it can . it is every 10 miliseconds - normal variant)
second try - more load on processor. using every pixel calculations (use 0)
bench time - 30 secs
hm. it slows down LCD dispay. lets see what we have in file (by the way. debug information is added to end of file. just scroll down)
--- 2008-01-30 15:28:19
CHDK Ver: allbest [ #16 ]
Build Date: Dec 29 2007 14:18:21
Camera: a630 [ 100c ]
[8x6], threshold: 0, interval: 0, pixels step: 1
region: [1,1-8,1], region type: 0
wait interval: 30000, parameters: 10, calls: 341, detected cells: 0
- - 212370
[1] - 212480
[2] - 212570
[3] - 212660
[4] - 212750
[5] - 212840
[6] - 212930
[7] - 213020
[8] - 213110
[9] - 213200
surpise. md detection slow down all chdk
lets see
30 seconds
341 calls
so it takes 80-90 milliseconds to make comparisons using every pixel
so.
how to use it properly then?
use every 100th pixel?
anyway using so short times between comparisons takes processor time from CHDK
also I have noticed that it is useless to use compare time less then 30 - LCD update speed
also CHDK uses only one of three available buffers
there is a 30% chance that we will be in time to avoid 60 msecs loose (so use 30 msecs is logical)
of course chances will be 100% after aplying patch to use all three buffers
lets test 30msec + every 4th pixel
1) it will speed up calculation to 16 times ( 4 step for X and Y coordinates)
2) will not waste processor time unnecesary
what we got?
LCD is more live ( but not fast enough for me :-( )
lets see debug info file
--- 2008-01-30 15:47:15
CHDK Ver: allbest [ #16 ]
Build Date: Dec 29 2007 14:18:21
Camera: a630 [ 100c ]
[8x6], threshold: 0, interval: 30, pixels step: 4
region: [1,1-8,1], region type: 0
wait interval: 30000, parameters: 10, calls: 2910, detected cells: 0
- - 176590
[1] - 176610
[2] - 176620
[3] - 176630
[4] - 176640
[5] - 176650
[6] - 176660
[7] - 176670
[8] - 176680
[9] - 176690
[10] - 176700
[11] - 176710
30 secs/ 2910 calls = 10 msecs
ok. it seems it is almost safe to use pixel step 4 for my camera. in this case md code dont take away processor time from CHDK and calculates data in realtime
so if modification applyed to main trunk (to your camera) it is possible using 4pixels step to catch changes in 30 msecs interval.
waiting your debuging file