I haven't started debugging yet, but I don't think the U, V and RGB modes are correct in the new code for pre-digic6 cameras.
Here's the test procedure I used:
Display the attached html file
Set up the camera so it's focused at the screen, with the black rectangle near with middle of the frame, taking up roughly 60% of the frame width. Exact size doesn't matter, you just want to have several cells of the 5x5 md grid mostly covered by the rectangle, and several covered by the white background. Nothing other than the middle rectangle and white background should be in the frame.
AE lock or manual exposure should be set to the live view levels don't change when you switch colors.
in chdkptp (with the extras/md.lua from the latest SVN)
!m=require'extras/md' m.init()
To test how the colors are interpreted in a given measure mode, use a command like
!m.print_result(m.do_md({threshold=10,mode='y',timeout=300,wait=true,cell_vals=true}))
For chdk builds before 4771, you need to add start_delay=20.
In this case, we aren't interested in actually detecting motion, just the values seen in the cells. The output will be something like
cells: 0 time: 0.320
values:
179 200 208 200 175
211 146 96 91 206
220 93 14 10 218
224 89 11 10 220
217 233 238 230 211
The "cells 0" line shows that MD has not triggered, which it shouldn't in a static scene like this. If it does trigger, it could be due to a bug, changes in the scene or a low threshold. You can use cell_diffs=true to see the trigger values.
To switch colors, click on the color at the top, or press the key with the matching number. Run the chdkptp command again after each change.
expected results:
Y mode
Black will be low (~0), white will be high (~200).
Other colors will be in between.
U mode
Unsaturated colors (black, grey, white) will all be ~0
cyan will be positive
magenta will be positive
green will be negative
V mode
Unsaturated colors (black, grey, white) will all be ~0
cyan will be negative
magenta will be positive
green will be negative
R, G, B modes
black will be ~0
white will be high
the color matching the measure mode will be similar to white
the other pure colors will be similar to black
The current svn code on pre-digic 6 meets all of these.