Canon vs CHDK histograms - General Help and Assistance on using CHDK stable releases - CHDK Forum supplierdeeply

Canon vs CHDK histograms

  • 88 Replies
  • 15515 Views
Canon vs CHDK histograms
« on: 09 / May / 2021, 02:55:31 »
Advertisements
I raised the above question in another post, but have posted here as I believe it needs a separate thread.

What I’m seeing are noticeable differences between the Canon and CHDK histograms, see attached, where I’ve attempted to emulate the Canon histogram in CHDK, ie linear and ignore peaks set to 0.

What I see in CHDK are shifts to the left in Ev space and highlight warnings when there are none.

I’m only posting one picture to illustrate what I’m seeing, and asking others to confirm my observations.

Cheers

Garry

*

Offline c_joerg

  • *****
  • 1250
Re: Canon vs CHDK histograms
« Reply #1 on: 09 / May / 2021, 09:19:12 »
Have you ever looked at the histogram in Lightroom or other programs?
i would guess that the y scale is standardized differently.
I would like a RAW histogram ...
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

Re: Canon vs CHDK histograms
« Reply #2 on: 09 / May / 2021, 09:55:42 »
It's not the y scale that bothers me, but the way the x axis (EV or stops) is different. Plus, I'm not sure how the CHDK histogram is deciding the over (highlight) warning.

As you say, I will 'calibrate/compare' in Rawdigger and decide what histogram is 'best' to use in camera: CHDK or Canon.

Cheers

Garry

*

Offline c_joerg

  • *****
  • 1250
Re: Canon vs CHDK histograms
« Reply #3 on: 09 / May / 2021, 10:05:56 »
With a RAW histogram you can pretty much say how much an EV is (doubling the data).
With JPG it definitely depends on many cam settings...
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd


Re: Canon vs CHDK histograms
« Reply #4 on: 09 / May / 2021, 10:18:06 »
@c_joerg

Agreed, which is why I’m leaning towards the CHDK being more representative of a RAW capture, as, I believe the Canon histogram is based on a miniature JPEG, whereas the CHDK is not.

Re: Canon vs CHDK histograms
« Reply #5 on: 09 / May / 2021, 12:43:03 »
Just did some outdoor (landscape) testing with both Canon and CHDK histograms on the screen: the differences are stark.

The CHDK histogram had the same overall shape as the Canon, but was shifted about 2eV towards the shadows.

I could accept a fraction of an eV difference, but 2 seems excessive.

I'll carry on testing, but would welcome others looking at their cams, ie have both histograms on display at the same time.

*

Offline reyalp

  • ******
  • 14110
Re: Canon vs CHDK histograms
« Reply #6 on: 09 / May / 2021, 13:17:44 »
Agreed, which is why I’m leaning towards the CHDK being more representative of a RAW capture, as, I believe the Canon histogram is based on a miniature JPEG, whereas the CHDK is not.
The CHDK live histogram works by reading the 8 bit YUV live view buffer, so it definitely isn't going directly off raw values. That code has existed since before my involvement, and I'm not clear how the original mapping to EV values was arrived at.

Digic 6 and later have viewport buffers use a somewhat different range of values than earlier cams (you generally have to adjust the zebra limits to get reasonable over/under indications) so it's quite possible that whatever calibration there was for the original histogram is less valid.

tl;dr: It could easily be broken and would be worth looking into. I'll try to compare with a pre-digic 6 cam when I have a moment.
Don't forget what the H stands for.

Re: Canon vs CHDK histograms
« Reply #7 on: 09 / May / 2021, 13:28:56 »
@reyalp

Quote
I'll try to compare with a pre-digic 6 cam when I have a moment.

I would welcome someone else confirming my observations.

The skewed CHDK histogram I’m seeing is one thing, then there is the CHDK highlight warning, that may also need another look, ie for new cams.

It is very noticeable on the M3, ie both histograms showing at the same time.

Cheers

Garry


*

Offline reyalp

  • ******
  • 14110
Re: Canon vs CHDK histograms
« Reply #8 on: 09 / May / 2021, 18:37:11 »
I looked at this a bit on g7x.
Note the Canon histogram on g7x is one color, and it's not entirely clear what it measures. The manual says "distribution of brightness on the image" which suggests Y channel.

I initially set the CHDK histogram to linear, RGB, autoscale off.

Initially, when I tested, I would always get the warning dots, and the histogram seemed to periodically (once per second ish) show small peaks repeatedly appearing where there were none. Even turning "ignore boundary peaks" up to 32 didn't get red of the warning dots. All of these suggest the histogram is sampling something partly outside valid image data.

Looking at my screenshots, I realized I had the still aspect ratio set to 4:3. This *shouldn't* break CHDK histogram, but none of the other aspect ratios showed the same problems. So I suspect g7x has some problem viewport definitions in 4:3, even though chdkptp live view seems OK.

However, the peaks still didn't match. Switching to Y mode gives a much better match to the Canon histogram, but there are still some issues.

In the first attached image
* Top left: Flat, neutral image. Peak is in the middle of the EV chart on both, with more slop on the left. Looks correct, IMO.
* Top right: Main peak in the CHDK histo might be a little lower but could be due to resolution. Peak in the lowest EV bin definitely seems higher than the one the Canon histo.
* Bottom two: Again, lower peak in CHDK histo is shifted up a bit compared to Canon. Canon clips the main peak, but it seems like it's in the right place.

Second image:
* Left: Intentionally over exposed. CHDK histo seems to clip before it gets to the top of the top EV bin, and never shows the over warning. This is consistent with zebra needing larger (~24 Y units) margin old ports.
* Right: Same story at the low end. CHDK histo clips just after the middle of the lowest bin, warning not triggered.

The clipping behavior above is not seen on my pre-digic 6 cams. This implies that Y range actually used on D6 cams is smaller than the range used on earlier cams (already noted previously from zebra behavior)

I know this isn't the problem you reported ;)

A few other general notes:
* CHDK histogram in playback samples the entire screen, so it will be wildly off if the image isn't displayed full screen or is letterboxed.
* CHDK histogram is affected by white balance and other Canon color effects (except maybe not much in Y mode), since it samples the the displayed YUV buffer. It doesn't sample the Canon focus peaking, since that doesn't appear in the live view buffer.
* CHDK histogram samples the whole image, theoretically accounting for letterboxing in different aspect ratios (but, this could be broken). It's not clear if the Canon histo does, but judging how it responds to changes near the edge, it probably covers most the image too.

edit:
Confirmed CHDK histogram very likely has problems if the used part of the viewport isn't 720 or 960 wide.
« Last Edit: 09 / May / 2021, 21:38:08 by reyalp »
Don't forget what the H stands for.

Re: Canon vs CHDK histograms
« Reply #9 on: 10 / May / 2021, 01:03:34 »
@reyalp

Thanks for confirming the weirdness, I was worried about flagging what I was seeing, as no one else has and the histogram has been with CHDK for so long.

The immediate user palliative is to not use the CHDK histogram on the M3, and maybe other cameras?

As for a ‘solution/fix’, I guess that is going to need someone with time and knowledge of the C code in the histogram module. I’m afraid it’s beyond me to look at this :-(


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal