zebra show overexpose better when rgb zebra is used - General Discussion and Assistance - CHDK Forum supplierdeeply

zebra show overexpose better when rgb zebra is used

  • 28 Replies
  • 15074 Views
zebra show overexpose better when rgb zebra is used
« on: 27 / April / 2011, 05:24:09 »
Advertisements
I do some tests and see that when rgb zebra is switch in menu on, it show better overexpose if only 1 color is overexpose.for example i get blue overexpose often before all channels are overepose

But sometimes only green blue and black is not good visible on display in bright sun.so best for me is to use red on normal mode but see overexpose correct without rgb zebra.

red as overexpose is good see on bright sun.

Can this fix ?
Ixus 1000 HS

*

Offline reyalp

  • ******
  • 14082
Re: zebra show overexpose better when rgb zebra is used
« Reply #1 on: 27 / April / 2011, 12:29:33 »
I would expect the regular zebra to be more accurate, since it's based on the Y component of the original YUV buffer. If regular zebra says there is no over exposure but RGB does, it's probably an artifact of the conversion.

If you want accuracy, you would need to calibrate it with actual images (assuming there is a stable relationship between the viewport and raw, which I'm not sure is established.)
Don't forget what the H stands for.

Re: zebra show overexpose better when rgb zebra is used
« Reply #2 on: 28 / April / 2011, 10:25:22 »
I would expect the regular zebra to be more accurate, since it's based on the Y component of the original YUV buffer. If regular zebra says there is no over exposure but RGB does, it's probably an artifact of the conversion.

If you want accuracy, you would need to calibrate it with actual images (assuming there is a stable relationship between the viewport and raw, which I'm not sure is established.)

I look into source of it, and it look for me as for non rgb zebra only the y color is used.I guess conf.zebra_multichannel is the variable of GUI setting "rgb zebra"

as far i understand yuv its possible that y have a low value and only together with the U and v value it reach a high value.

Code: [Select]
                   yy = img_buf[v+1];
                    if (conf.zebra_multichannel) {
                        uu = (signed char)img_buf[v];
                        vv = (signed char)img_buf[v+2];
                        sel=0;
                        if (!((conf.zebra_mode == ZEBRA_MODE_ZEBRA_1 || conf.zebra_mode == ZEBRA_MODE_ZEBRA_2) && (y-x-timer)&f)) {
                            if (clip8(((yy<<12) +           vv*5743 + 2048)>>12)>over) sel  = 4; // R
                            if (clip8(((yy<<12) - uu*1411 - vv*2925 + 2048)>>12)>over) sel |= 2; // G
                            if (clip8(((yy<<12) + uu*7258           + 2048)>>12)>over) sel |= 1; // B
                        }
                        buf[s]=buf[s+1]=cls[sel];
                    }
                    else if (((conf.zebra_mode == ZEBRA_MODE_ZEBRA_1 || conf.zebra_mode == ZEBRA_MODE_ZEBRA_2) && (y-x-timer)&f)) buf[s]=COLOR_TRANSPARENT;
                    else buf[s]=(yy>over)?cl_over:(yy<conf.zebra_under)?cl_under:COLOR_TRANSPARENT;

maybe code can enhance that for normal mode

 if (clip8(((yy<<12) +           vv*5743 + 2048)>>12)>over) sel  = 4; // R
                            if (clip8(((yy<<12) - uu*1411 - vv*2925 + 2048)>>12)>over) sel = 4; // R
                            if (clip8(((yy<<12) + uu*7258           + 2048)>>12)>over) sel = 4; // R

I have not test if that work ?
« Last Edit: 28 / April / 2011, 10:37:21 by Bernd R »
Ixus 1000 HS

*

Offline reyalp

  • ******
  • 14082
Re: zebra show overexpose better when rgb zebra is used
« Reply #3 on: 28 / April / 2011, 12:14:15 »
as far i understand yuv its possible that y have a low value and only together with the U and v value it reach a high value.
Y is luminance, so that would correspond to a dark scene, wouldn't it ? read posts from a1ex

The whole zebra process should be considered as a general guide, not something exact. Have you calibrated what is "over-exposed" in zebra with what comes out as white level in the raw ?

If not, there is no point in fiddling with the zebra code.
« Last Edit: 29 / April / 2011, 12:25:33 by reyalp »
Don't forget what the H stands for.


*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: zebra show overexpose better when rgb zebra is used
« Reply #4 on: 28 / April / 2011, 12:19:13 »
Just implemented this in Magic Lantern. It shows clipped channels with the opposite color (e.g. clipped R shown as cyan, clipped blue shown as yellow...)

There are situations where certain channels (R, G or B) clip at low luma values (even 70%), and it's not an error in conversion, but it's due to over-saturation. RGB zebras can show this situation, but Y zebras can't.

https://bitbucket.org/hudson/magic-lantern/changeset/2d833487906d

When you are shooting RAW, RGB zebras may not make sense; they need calibration, as reyalp pointed out.
« Last Edit: 28 / April / 2011, 12:22:55 by a1ex »

Re: zebra show overexpose better when rgb zebra is used
« Reply #5 on: 29 / April / 2011, 10:25:27 »
Here are pictures of colors that have Y 0 or Y0.5

http://en.wikipedia.org/wiki/YUV

this i see too when i shoot flowers which are very red blue etc.zebra show no overexpose, RAW is then too overexpose.

I see that my camera have not much gain available in RAW.

I guess because of noise, the camera expose upto 4096 or short before and set this as full bright.

I can in RAW only reach more details in black range.but then noise is more.so i use rgb zebra.

>Just implemented this in Magic Lantern. It shows clipped channels with the opposite color (e.g. clipped >R shown as cyan, clipped blue shown as yellow...)

Problem on new cameras is that they have not much colors available that stay constant and the display can bad see on sunlight.

I do the next shooting with rgb zebra and all overexpose is show as red, and see if results get better.
Ixus 1000 HS

*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: zebra show overexpose better when rgb zebra is used
« Reply #6 on: 29 / April / 2011, 11:36:56 »
A bit of math (reversed from firmware by AJ, http://magiclantern.wikia.com/wiki/ASM_Zedbra ):

R = Y + 1.403V'
G = Y - 0.344U' - 0.714V'
B = Y + 1.770U'

Y is uint8, U and V are int8. You can saturate red channel with V=127, i.e. at Y=77 (only 30% brightness). Blue is even easier to saturate, and green is a bit harder.

Re: zebra show overexpose better when rgb zebra is used
« Reply #7 on: 30 / April / 2011, 14:38:57 »
I found that on most Canon cameras that the R channel is too high from the factory, so I use a "Custom Colors" setting of R -2, G 0, B 0. I also set contrast and sharpness at -2. Low contrast to make sure the JPG output will contain the full dynamic range of the RAW sensor data, and low sharpening because I can do that better on the computer than the camera can. Once the camera has created harsh sharpening halos they can't be removed in editing.

The problem with the R channel being too high can cause problems when using any of the RGB histogram or zebra modes.

But there's always been a problem with the RGB Zebra mode. You have to set the OverExposure Threshold to 32 when using RGB Zebra in order to get it to display the C, Y, and M regions when when the B+G, R+G, and R+B channels (respectively) are blown out. I never use RGB Zebra because of this problem it has always had. Until this is fixed RGB Zebra really isn't all that useful for much of anything.

To see for yourself, load up a Granger Chart on your monitor (has all possible colors and luminance values displayed in even graduations). Then set your camera to RGB Zebra mode and set your camera's exposure settings so the lighter colors are all blown-out. You will only see the C, Y, and M areas fully appear when you set the zebra OverExposure Threshold to 32. Lower values than that and those regions of channel-combos that are blown out diminish greatly, where they completely disappear at OverExposure Threshold values of about 12 or less.

If you don't have a Granger Chart for testing (or know how to easily make one with your favorite editor) here's a downsized one you can use.

http://farm6.static.flickr.com/5307/5673254230_96f2049213_b.jpg



Re: zebra show overexpose better when rgb zebra is used
« Reply #8 on: 01 / May / 2011, 07:20:58 »
@a1ex
>R = Y + 1.403V'
>G = Y - 0.344U' - 0.714V'
>B = Y + 1.770U'

can you please make out of your values code that can work in chdk ?.I look in your source, but i do not understand how i need change chdk so it get working.

the granger chart is a  good test and it show that rgb zebra show 25 units  too early overexpose in colors.so the chdk values of rgb seem not best possible and i like to try your values.

if you can add code so it work in integer, i can test if it work better.

thats the original rgb code

if (clip8(((yy<<12) +           vv*5743 + 2048)>>12)>over) sel  = 4; // R
                            if (clip8(((yy<<12) - uu*1411 - vv*2925 + 2048)>>12)>over) sel |= 4; // G
                            if (clip8(((yy<<12) + uu*7258           + 2048)>>12)>over) sel |= 4; // B

When i capture a image with rgb zebra and exposure correct on zebra, image look correct in jpg.but can be a little more erxposure get.In default zebra i get no overexpose warning in colors, and later colors are overexpose.RAW look a little less overexpose, but its still overexpose in colors.

I notice the Canon zebra show show too only Y value.

@newbietoobie
>The problem with the R channel being too high can cause problems when using any of the RGB >histogram or zebra modes.

On Ixus 1000 red channel is too a little higher.problem i have that this camera have no option to reduce sharpen

if this is possible i can avoid most times to use raw.
On this camera happen on hair for example that some hairs are shapren some hairs are more blur as RAW or contain blocks.superfine jpg save do not help, so i guess its depend on denoise
« Last Edit: 01 / May / 2011, 07:22:48 by Bernd R »
Ixus 1000 HS

*

Offline Lebeau

  • ***
  • 187
Re: zebra show overexpose better when rgb zebra is used
« Reply #9 on: 01 / May / 2011, 09:03:44 »
Bonjour,

I don't know why you are expecting precise zebra but ...

Current zebra is based on the viewport and is compute like the following integer formulas :
Code: [Select]
img = vid_get_viewport_live_fb ( );
triplets_in_bytes = 3 * ( buffer_width * ( row_offset + row ) + ( col_offset + col ) );
yc = img [ triplets_in_bytes + 1 ] * 4096;
cb = ( signed char ) img [ triplets_in_bytes ];
cr = ( signed char ) img [ triplets_in_bytes + 2 ];
red = clip ( ( yc + ( 5742 * cr ) + 2048 ) / 4096 );
green = clip ( ( yc - ( 1410 * cb + 2925 * cr ) + 2048 ) / 4096 );
blue = clip ( ( yc + ( 7258 * cb ) + 2048 ) / 4096 );
Note: I low-rounded 5743 and 1411 to 5742 and 1410 for precision purpose :) since rounding is included in "+2048"

These Viewport's YCbCr digital video data are resulting from CCD-to-Video signal process using sensor raw data as input.

RGB data are therefore approximate from YCbCr digital video data that is approximate from raw photo cells that approximate photons counts, due to noise :).

I still don't know why you are expecting precise zebra but ...

P.S.: You are in savana and look at a zebra, garnished with  nice black & white stripes. When you shoot it, were the muscle more or less voluminous?

 

Related Topics