Histogram - page 4 - General Discussion and Assistance - CHDK Forum

Histogram

  • 109 Replies
  • 30143 Views
*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #30 on: 18 / January / 2013, 14:06:01 »
Advertisements
Thanks for the quick turn around, however, something strange is happening. My G11 is a 12b, like the S95, however, when I run the same script, using your call, clearly it is not returning the actual (sampled) count, ie I only get 0 or 1 returned.
I've been making a lot of changes lately, so maybe that build didn't have all the histo stuff. I tested this builid with my sx260. Try it on your camera and we'll go from there.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Histogram
« Reply #31 on: 18 / January / 2013, 15:07:43 »
Lapser

I'm afraid that did not do it.

The exact same script runs differently on the S95 compared to the G11.

BTW I downloaded the correct 1.2 G11(j) and then replaced with your files.

On the S95, I see the corrent sampled counts. On the G11 all I see is a 0 or a 1 returned.

Stranger and stranger!

Cheers

Garry

*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #32 on: 18 / January / 2013, 16:48:53 »
Stranger and stranger!
I wonder if it didn't actually load the new files for some reason. Add this at the beginning of your script:

print(get_histo_range(-2))

It should print "4096".  If it throws a lua error, you may not have my code installed for some reason. My code doesn't get installed with the firmware update method, only the auto boot. We'll figure it out eventually.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Histogram
« Reply #33 on: 18 / January / 2013, 17:00:27 »
Lapser

Just tried it and got Lua error no value.

;-)

Garry

*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #34 on: 18 / January / 2013, 17:13:42 »
Lapser

Just tried it and got Lua error no value.

;-)

Garry
Are you sure you're over-writing everything in the zip file, including the modules in the CHDK folder? With Windows 7, I open the zip file, press control+A, then control+C to copy all the files and folders in the zip. I go to the root directory of the SD card, and press control+V to paste all the files, and choose the options to overwrite all files and directories.

Check the dates on the files in CHDK/MODULES on the SD card to make sure they're new.

This could be the problem, since philmoz moved the luascript code to a module now.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Histogram
« Reply #35 on: 18 / January / 2013, 17:26:33 »
I'm sorry I wasted your time.

I did a fresh reload of your files and all is OK!

I was convinced I had changed the files.

Sorry.....

Garry

*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #36 on: 18 / January / 2013, 18:45:34 »
I did a fresh reload of your files and all is OK!
Sorry.....
If you don't feel like an idiot, you haven't found the problem. CHDK means never having to say you're sorry.

I used to not bother with over-writing the CHDK folder modules either, since they hardly ever changed. But with the main lua file now a module, most of my changes will involve replacing the modules. I suspect that a lot of people will make the same mistake.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Histogram
« Reply #37 on: 18 / January / 2013, 19:09:51 »
I used to not bother with over-writing the CHDK folder modules either, since they hardly ever changed. But with the main lua file now a module, most of my changes will involve replacing the modules. I suspect that a lot of people will make the same mistake.

I use chdkptp and batch files to upload CHDK to my cameras - that way everything gets updated and I don't have to worry about what's changed or not.

Command to send CHDK to camera (I store this is a .cmd file):
Code: [Select]
e:\chdk\chdkptp\trunk\chdkptp.exe -i -c < e:\chdk\tools\update_cam.txt
update_cam.txt file
Code: [Select]
u -nolua bin\diskboot.bin A/diskboot.bin
u -nolua bin\ps.fi2 A/ps.fi2
u -nolua CHDK\MODULES\4wins.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\benchm.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\calend.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\curves.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\edgeovr.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\fselect.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\grids.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\mastmind.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\mdetect.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\memview.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\modinsp.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\mpopup.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\palette.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\reversi.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\snake.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\sokoban.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\sudoku.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\tetris.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\txtread.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\zebra.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\_dng.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\_osd_le.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\_rawop10.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\_rawop12.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\_tbox.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\ubasic.flt A/CHDK/MODULES/
u -nolua CHDK\MODULES\lua.flt A/CHDK/MODULES/
reboot

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Histogram
« Reply #38 on: 18 / January / 2013, 19:22:56 »
Lapser

More strangeness.

Using the same script and your get_histo_range function returns strange things with the G11. On the S95 the function returns what looks the right data, when I check the RAW with Rawdigger.

On the G11 when I check beyond the back point, ie 127 to, say, 130, the function returns data, eg 80.  But I no there is no count in this range as in Rawdigger it is clearly 0.

Any ideas?

Cheers

Garry

*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #39 on: 18 / January / 2013, 20:02:34 »
More strangeness.
Using the same script and your get_histo_range function returns strange things with the G11. On the S95 the function returns what looks the right data, when I check the RAW with Rawdigger.
On the G11 when I check beyond the back point, ie 127 to, say, 130, the function returns data, eg 80.  But I no there is no count in this range as in Rawdigger it is clearly 0.
I assume you're using dng RAW files produced by CHDK? I'm computing the histogram from the raw data bytes right from the camera sensor, before any processing. There's some processing involved in computing a DNG file, so maybe the almost black pixels get clipped in the conversion. Maybe reyalp, philmoz, or one of the other RAW/DNG jocks could elaborate.

The black level of 127 is an approximation. The actual level depends on the background noise in the sensor, which gets higher with temperature. The G11 might have a higher noise level, and thus a higher black level.

Incidentally, the new shot histogram goes with the new shot meter functions. The histogram uses meter #1. You can set the area of the histogram with meter #1 as follows:

set_shot_meter(1,x1,y1,x2,y2)
shot_histo_enable(1)

x1,y1,x2,y2 are values from 0 to 100  which are percentages of the total active sensor area. If you omit the first set_shot_meter call, shot_histo_enable(1) calls:

set_shot_meter(1,0,0,100,100)

after taking a shot, you can call:

ev_delta=get_shot_meter(1) -- or just get_shot_meter()

Then you can adjust the exposure with:

set_tv96_direct(ev_delta+get_tv96())

this sets the average pixel value of the next shot at 192 below the 50% linear pixel level (2 f stops)
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

 

Related Topics


SimplePortal © 2008-2014, SimplePortal