peaking filter

19 views
Skip to first unread message

Rui Madruga

unread,
Jan 4, 2011, 9:48:22 AM1/4/11
to Magic Lantern firmware development
Thanks for your fantastic work.

Is possible program a peaking filter for focus assist?

Sincerely

Rui Madruga

Antony Newman

unread,
Jan 4, 2011, 12:15:16 PM1/4/11
to ml-d...@googlegroups.com
Hi Rui,

I don't know what a peaking filter is!  (unless its like me jumping up when someone cooks yummy Chinese food :D )

It currently has Zebras Over exposure (and under)... In the crop marked region / outside the Overlay itself.

I originally had the Zebra inside the Overlay too .. but then removed them (duplication = waste of CPU).

I'm going answer the other thread from Moira regarding Histogram.

AJ.

James Donnelly

unread,
Jan 4, 2011, 12:26:09 PM1/4/11
to ml-d...@googlegroups.com


On 4 January 2011 17:15, Antony Newman <antony...@gmail.com> wrote:
Hi Rui,

I don't know what a peaking filter is!  (unless its like me jumping up when someone cooks yummy Chinese food :D )


It is just edge detection.  I think this has been talked about in other threads, but I'm not sure if there was a conclusion.

The way it's implemented in a Marshal field monitor is by showing a monochrome image with red highlights on detected edges.

If it was possible to implement, I'm guessing we'd have the same re-draw lag seen in zebras, which would make it less direct than reading the zoom vram as you are doing.

Moira O'Brien LIPF

unread,
Jan 4, 2011, 1:20:54 PM1/4/11
to ml-d...@googlegroups.com
Hello James

Edge detect is available in the current versions of ML for the 5D but it is not accurate enough to be of any practical use.  AJ's new focussing zoom seems to be a much better option.

regards

Moira


--
http://magiclantern.wikia.com/
 
To post to this group, send email to ml-d...@googlegroups.com
To unsubscribe from this group, send email to ml-devel+u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/ml-devel?hl=en

James Donnelly

unread,
Jan 4, 2011, 2:04:34 PM1/4/11
to ml-d...@googlegroups.com
On 4 January 2011 10:20, Moira O'Brien LIPF <mo...@moiraobrien.com> wrote:
Hello James

Edge detect is available in the current versions of ML for the 5D but it is not accurate enough to be of any practical use.  AJ's new focussing zoom seems to be a much better option.

regards

Moira


Silly me, just re-read the old posts more thoroughly and see that it's AJ's post I was recalling.  Doh.   

Rui Madruga

unread,
Jan 4, 2011, 4:14:16 PM1/4/11
to Magic Lantern firmware development
http://www.lcdracks.com/monitors/V-LCD50-HDMI.html

In this link what is a peaking filter.

Thank you for your attention.

Sincerely

Rui Madruga

Antony Newman

unread,
Jan 4, 2011, 4:55:34 PM1/4/11
to ml-d...@googlegroups.com
Thanks for that Rui.

When I coded the edge detection in assembler .. I started with a one pixel accurate version of the 2 pixel version in ML.
I didn't like it the Luma was not consistent, and the image was blockly  (top crossed out ASM).

I then moved onto using 4 very specific colours (next two).  This was based by watching the Peaking video that you linked.

Then moved onto the bottom ASM .. which gives 16 shades of luma, and for the real edge detection changes.

I haven't 'exposed' many people to the Edge detection code (Sobel tranform) that goes before this ... it can leave you feeling a bit radio-active.



On the Plus side .. and I meant to mention this earlier.

Using a 'Fake Tan' (not sure if False Colours has a TM) may be straightforward if you can choose a suitable colour from the overlay palette:
http://magiclantern.wikia.com/wiki/2.0.4_5D2_VRAM_overlay

The Focus_Assist overlay has a startup routine that calculates the complete transform of colour based on YUV -> RGB
The False colour used by Marshal does a Y-> RGB (ie much simpler transform!).

Maybe this should be a separate Mode / and Full screen (within cropmarks).  I am not going to work on this now (it is pretty straightforward to do).



EdgeDetectedPix1 - Based on TH
ORR Col,Col,0x70
ADD Col,Col,R14,LSR#23+4 Only use top 5 bits for 32 colours
EdgeDetectedPix1 - Based on 4 hand selected colours - Stored in Register R1
CLZ R14,R14 How many leading Zeros. 0,1,2,3  
MOV R14,R14,LSL#3  = 0, 8, 16 or 24
MOV R14,R1,ROR R14  = Rotate colour of 0x5B.55.6F.08     [0x08 is brightest, 0x5B is dim]
AND R14, R14, #0xFF
ORR Col,Col,R14 Set to Edge detected bright Red colours or
EdgeDetectedPix1 - Based on 4 hand selected colours - Calculated on the fly
MOV R2,#0x00.00.00.5B Very Dark Red
TST R14,#0x20.00.00.00
MOVNE R2,#0x00.00.00.55 Dark Red
TST R14,#0x40.00.00.00
MOVNE R2,#0x00.00.00.6F Light Red
TST R14,#0x80.00.00.00
MOVNE R2,#0x00.00.00.08 Bright Red
ORR Col,Col,R2 Set to Edge detected bright Red colours or
EdgeDetectedPix1 - Based on AJ as the VRAM colours are not Luma order
MOV R14, R14, LSR#24+4 R14 =0..0xF
RSB R14, R14,#00.00.00.6F R14 = a colour from 0x60 .. 0x6F
ORR Col,Col,R2 Set to Edge detected to be a red colour (up to white red)


AJ

Piers

unread,
Jan 4, 2011, 6:01:54 PM1/4/11
to ml-d...@googlegroups.com
A crude horizontal-only peaking (using green 'cos the zebs are red or blue) based on rate of rate of change is in my todo list, just to see whether it's vaguely useful, but I don't think it will see the light of day for a while - I've got a 2 week holiday in a nearby country coming up, not sure how much net I'll have/want. 

(AJ and I are kind of inhabiting parallel universes here, and it will be some time before our code makes it into the main builds)
Reply all
Reply to author
Forward
0 new messages