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

Canon vs CHDK histograms

  • 88 Replies
  • 5152 Views
Re: Canon vs CHDK histograms
« Reply #60 on: 17 / May / 2021, 15:26:56 »
Advertisements
@reyalp

Have looked at several histograms, ie skewed left and right and normal looking.

This is a typical histo capture"

Quote
1,0
2,0
3,0
4,0
5,0
6,15
7,0
8,1
9,0
10,1
11,0
12,0
13,2
14,4
15,3
16,2
17,2
18,8
19,6
20,7
21,15
22,151
23,16
24,21
25,11
26,11
27,12
28,9
29,13
30,15
31,10
32,6
33,9
34,13
35,10
36,9
37,8
38,18
39,5
40,9
41,13
42,15
43,8
44,9
45,9
46,11
47,5
48,9
49,11
50,10
51,8
52,10
53,11
54,13
55,6
56,5
57,9
58,10
59,5
60,11
61,9
62,9
63,12
64,11
65,12
66,23
67,7
68,12
69,11
70,104
71,14
72,7
73,10
74,11
75,10
76,10
77,10
78,13
79,18
80,9
81,23
82,87
83,13
84,10
85,84
86,6539
87,26
88,33
89,8
90,18
91,12
92,10
93,12
94,69
95,10
96,17
97,12
98,13
99,13
100,17
101,12
102,27
103,24
104,15
105,21
106,30
107,22
108,17
109,22
110,30
111,19
112,20
113,17
114,23
115,30
116,18
117,27
118,58
119,29
120,28
121,37
122,26
123,34
124,29
125,39
126,28
127,31
128,41
129,31
130,32
131,34
132,26
133,39
134,23
135,41
136,32
137,42
138,28
139,31
140,27
141,25
142,33
143,37
144,31
145,32
146,30
147,36
148,24
149,41
150,43
151,37
152,40
153,41
154,51
155,26
156,52
157,55
158,55
159,53
160,57
161,46
162,35
163,56
164,47
165,47
166,42
167,59
168,47
169,36
170,58
171,43
172,50
173,46
174,49
175,48
176,49
177,42
178,57
179,45
180,52
181,40
182,51
183,50
184,52
185,48
186,49
187,49
188,49
189,38
190,42
191,34
192,37
193,31
194,40
195,40
196,44
197,43
198,52
199,37
200,51
201,54
202,43
203,53
204,42
205,40
206,43
207,46
208,45
209,46
210,40
211,55
212,29
213,40
214,86
215,49
216,57
217,48
218,52
219,56
220,59
221,81
222,56
223,63
224,58
225,50
226,36
227,45
228,32
229,41
230,52
231,50
232,44
233,52
234,49
235,46
236,39
237,45
238,33
239,40
240,45
241,52
242,76
243,62
244,29
245,29
246,22
247,23
248,27
249,14
250,28
251,24
252,23
253,27
254,30
255,266


There is always one entry, but not in the same place, that is huge. Entry 86 here, but will vary as I vary the exposure. Always just one entry.

Cheers

Garry

*

Offline reyalp

  • ******
  • 13457
Re: Canon vs CHDK histograms
« Reply #61 on: 17 / May / 2021, 18:41:04 »
That seems unlikely to be right. Having that big a peak would be really weird unless your scene was super uniform, and the number of values outside the 16-235 range seems suspect too.
For comparison, g7x pointing at a blank wall gives results like
Code: [Select]
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,3,13,9,27,38,36,54,97,150,262,423,646,779,913,1122,1215,1373,1964,1588,1325,873,654,471,284,66,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 [0]=0
}

Also, FWIWI, note the histo data starts a 0, not 1 like normal Lua arrays, because it's indexed by Y value. This means in Lua, you should use for i=0,255.. not something like for i,v in ipairs(...

Attached is a test build with the screen dump module included, which may help shed light on what's going wrong.

To use it, go to Miscellaneous->Debug Parameters and set "Alt +- debug action" to "DmpScrn"

Then, with the camera in rec mode, in alt mode, press the debug shortcut key. I think it will be the Info button on your cam, but if not, the alt help screen (enabled under CHDK settings->menu settings) should say.

The module will capture frames to DCIM/100CANON/CRW_nnnn.JPG. By default, it waits 5 seconds and records 5 frames. There is no feedback when it's done, so just count to 10 after pressing the button.
The file is not actually in jpeg format, it's a chdkptp lvdump. Please zip it and post it here, or on any file hosting site if it's too large for the forum.

Don't forget what the H stands for.

Re: Canon vs CHDK histograms
« Reply #62 on: 18 / May / 2021, 00:24:16 »
Quote
Also, FWIWI, note the histo data starts a 0, not 1 like normal Lua arrays, because it's indexed by Y value. This means in Lua, you should use for i=0,255.. not something like for i,v in ipairs(...

The 1 to 255 was just my printing formatting, ie i + 1, so the first entry is zero.

As soon as I can, I’ll do the screen dump and post the results.

Cheers

Garry

*

Offline reyalp

  • ******
  • 13457
Re: Canon vs CHDK histograms
« Reply #63 on: 18 / May / 2021, 03:17:26 »
As soon as I can, I’ll do the screen dump and post the results.
Thanks for sending the dumps. I'll have to write some code to analyze it properly, but the initial impression is that it's quite bizarre. The live view data looks completely normal, even though the histogram that should be built from the same data is not ???
Don't forget what the H stands for.


*

Offline reyalp

  • ******
  • 13457
Re: Canon vs CHDK histograms
« Reply #64 on: 22 / May / 2021, 21:55:22 »
A little progress
If M3 is like my d6 cams, there will never be anything in this range, as the Y values end around 235 even if the scene is totally blown out.
It turns out my g7x and sx710 only seem to use the 16-235 range, but my sx730 and the M3 lvdumps seem to use the full 0-255 range. So that part is at least somewhat explained.

It's not clear what determines the range used, or whether it's truly hardware specific, or potentially varies based on some setting. It's not a dryos rev thing, since M3 is 55p6 like g7x, while sx710 is 57 and sx730 is 59p4.
Don't forget what the H stands for.

Re: Canon vs CHDK histograms
« Reply #65 on: 23 / May / 2021, 01:11:39 »
Thanks for posting an update on your investigations.


*

Offline srsa_4c

  • ******
  • 4426
Re: Canon vs CHDK histograms
« Reply #66 on: 23 / May / 2021, 17:18:46 »
A little progress
It's not clear what determines the range used, or whether it's truly hardware specific, or potentially varies based on some setting.
I think it's specific to output device. The range issue has come up before, around here.

*

Offline reyalp

  • ******
  • 13457
Re: Canon vs CHDK histograms
« Reply #67 on: 23 / May / 2021, 19:19:11 »
I think it's specific to output device. The range issue has come up before, around here.
Thanks for that. Have you seen it change with EVF / HDMI / TV?

FWIW, g7x seems to be the same (16-235) for LCD and TV out, at least.


Unrelated addition to my growing list of histogram bugs: get_live_histo "total" can be incorrect if viewport width isn't evenly divisible by the step size. Digic 6 640x480 for example returns 12800, but actually samples 12960 pixels. This should only cause minor errors calculating percentages, AFAIK this error doesn't cause it to sample outside the image region (but weird behavior on M3 is still unexplained).
Don't forget what the H stands for.


*

Offline srsa_4c

  • ******
  • 4426
Re: Canon vs CHDK histograms
« Reply #68 on: 24 / May / 2021, 11:48:07 »
Have you seen it change with EVF / HDMI / TV?
Well, looks like my assumption was wrong. I checked black level in the viewport buffer. On sx280, it's always 16 (lcd, tv-out, hdmi). On m10, it's always zero (lcd, hdmi).

*

Offline reyalp

  • ******
  • 13457
Re: Canon vs CHDK histograms
« Reply #69 on: 02 / June / 2021, 00:51:34 »
@pigeonhill I found an issue with CHDK histogram specific to the new drawing method, so here's an update to the test build from earlier

If you can check whether CHDK hisogram in this build roughly matches the Canon luminosity histo, that would be appreciated.

Note both the bug and the changes in this build only apply to the CHDK on screen histogram, not Lua get_live_histo.
Don't forget what the H stands for.

 

Related Topics