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

Histogram

  • 109 Replies
  • 29433 Views
*

Online reyalp

  • ******
  • 14119
Re: Histogram
« Reply #70 on: 20 / January / 2013, 16:34:01 »
Advertisements
Well, I'm not sure what the dots are. They could be part of the wall pattern, I suppose. Do you have something more uniform and gray you could try a test DNG with?
A simple way to ensure that stuff like this isn't real (form the scene) is to take the shots out of focus.
Don't forget what the H stands for.

Re: Histogram
« Reply #71 on: 20 / January / 2013, 16:46:23 »
All

Here are the results from further testing on the G11.

If I look at the count in bins 125 to 135 and I don't use the shot_meter_enable(1,1,1,99,99) call, I find the count asymptotes to a random fluctuation of between about 90 to 110 counts, when I am expecting zero (according to RawDigger)

If I use shot_meter_enable(1,1,1,99,99) my script behaves as I would expect, ie the count between 125 and 135 starts off high Iie underexposed) and falls to zero as I change the exposure. Remember I am doing an auto bracketing script and am checking for underexposure when testing the low order histogram bins.

In other words, I have a stable script by calling shot_meter_enable(1,1,1,99,99).

Of course on the S95 my script runs OK without calling shot_meter_enable(1,1,1,99,99).

Cheers

Garry

*

Online reyalp

  • ******
  • 14119
Re: Histogram
« Reply #72 on: 20 / January / 2013, 16:50:25 »
FWIW, the colored dots you see in the G11.DNG are definitely bad pixels, known to the canon firmware as bad. Canon sets these to value 0. The reason you see colored spots is that only one R, G or B element is 0, so you get the other two colors when it's debayered.

If you use DNG 1.1, chdk will interpolate over these for DNG. Alternately, if you use Adobe DNG software, it should take care of them.

edit:
Also, the black line at the top indicates the active area is not set correctly.
Don't forget what the H stands for.

*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #73 on: 20 / January / 2013, 17:12:05 »
In other words, I have a stable script by calling shot_meter_enable(1,1,1,99,99).
Of course on the S95 my script runs OK without calling shot_meter_enable(1,1,1,99,99).
OK, that sounds like the G11 active area is off then. I don't think it will effect the metering or histogram to shrink the histogram area 1% for all cameras. Part of the active area is clipped to correct lens distortion anyway.
FWIW, the colored dots you see in the G11.DNG are definitely bad pixels, known to the canon firmware as bad. Canon sets these to value 0. The reason you see colored spots is that only one R, G or B element is 0, so you get the other two colors when it's debayered.
Thanks for that info! I think my step size for sampling the raw buffer is around 30 or 40, when computing a histogram. I'm probably missing most of the bad pixels. Does the Canon firmware set the known bad pixels to 0 before build_shot_histogram() is called? If I happened to sample one, this means it would show up at position 0 in the histogram, well below the black level, so it's easy to spot.
Quote
edit:
Also, the black line at the top indicates the active area is not set correctly.
That's what I thought. I'll leave it to you or philmoz to figure out the correction. Thanks.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos


*

Online reyalp

  • ******
  • 14119
Re: Histogram
« Reply #74 on: 20 / January / 2013, 17:17:51 »
Does the Canon firmware set the known bad pixels to 0 before build_shot_histogram() is called? If I happened to sample one, this means it would show up at position 0 in the histogram, well below the black level, so it's easy to spot.
Yes. On some cameras the value may not be zero, but it should always be quite a bit less than black level. CHDK badpixel code uses DNG_BADPIXEL_VALUE_LIMIT as the minimum value. This is set to 16 on a few cameras.
Don't forget what the H stands for.

Re: Histogram
« Reply #75 on: 20 / January / 2013, 17:43:53 »
All

Many thanks for helping me get to a stable script, especially lapser for the histo calls.

Forgive me for slightly going off topic, but I'm also struggling with setting the MF in my script.

I have the camera in manual focus and set this to x.  In my script I call set_aflock(1) but the camera seems to refocus and ignore the camera and CHDK focus lock. Am I missing something or being stupid?

Cheers

Garry

Re: Histogram
« Reply #76 on: 20 / January / 2013, 17:55:01 »
BTW

I 'solved' it by not using aflock and explicitly calling x=get_focus at the beginning of the script and just before I capture an image I call set_focus(x)

*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #77 on: 20 / January / 2013, 18:18:04 »
I 'solved' it by not using aflock and explicitly calling x=get_focus at the beginning of the script and just before I capture an image I call set_focus(x)
That's probably the best solution if you're using shoot().

I think set_aflock has to be called in half shoot, and only in auto focus mode. That is:

Code: (lua) [Select]
if(get_focus_mode()~=1)then
  press("shoot_half")
  repeat sleep(10) until get_shooting()
  set_aflock(1)
  release("shoot_half")
  while(get_shooting())do sleep(10) end
end

EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos


*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #78 on: 20 / January / 2013, 18:56:39 »
By the way, another feature of my modifications is that set_tv96_direct() now works in half_shoot. You could do your histogram shots much faster like this:

Code: [Select]
press("shoot_half") -- focuses once and holds
repeat sleep(10) until get_shooting()
-- the above may not be needed.
-- Press("shoot_full_only") should focus the first time
-- get_shot_ready() only goes true AFTER get_shooting() is true

--shoot loop
  press("shoot_full_only")
  repeat sleep(10) until get_shot_ready(0) -- waits for histogram to be valid
  release("shoot_full_only") -- still holds shoot_half down
  --calculate your new tv96 value from the histogram here
  set_tv96_direct(tv96) -- works in half shoot immediately now
--repeat shoot loop
The new fuction, get_shot_ready() has an optional post shot delay parameter for shooting in continuous mode. The current default is 100 msec, so setting it to 0 will make it go faster in single shot mode.

If you're interested, and you get your script working with shoot_full_only, it should take shots at about 1 per second. Switching to continuous mode then speeds it up to 2 shots per second.
« Last Edit: 20 / January / 2013, 18:58:17 by lapser »
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Histogram
« Reply #79 on: 20 / January / 2013, 19:15:29 »
Lapser

Thanks, I look forward to playing/experimenting with this.

Cheers

Garry

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal