Histogram - page 5 - General Discussion and Assistance - CHDK Forum supplierdeeply

Histogram

  • 109 Replies
  • 29736 Views
Re: Histogram
« Reply #40 on: 18 / January / 2013, 20:09:57 »
Advertisements
Lapser

I have looked at the Cnon native RAW and looked at this file with RAWdigger.

As I ay, looking at an S95 canon RAW file you clearly see the area I sample as zero, and your function returns 0.

On a G11 canon RAW RAWdigger also shows zero data, ie I am overexposing so there I are no underexposed areas. But your function returns non-zero counts.

As I say, it is the same script in each camera.

I'm at a loss.

Garry

*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #41 on: 18 / January / 2013, 21:09:18 »
But your function returns non-zero counts.
I'm measuring the entire active area of the sensor, so maybe I'm measuring outside the normal range. There are masked areas outside the active area that might be doing something.

Why don' you try this to start your script:

set_shot_meter(1,2,2,98,98)
shot_histo_enable(1)

This will leave a border area around the edges of the sensor unsampled. See if that makes any difference.

[EDIT] What are the dimensions of the raw files you're looking at?
« Last Edit: 18 / January / 2013, 21:11:54 by lapser »
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Histogram
« Reply #42 on: 18 / January / 2013, 21:18:46 »
Lapser

My job on Saturday is to do some data gathering, based on your suggestions. I will post my results tomorrow.

Cheers

Garry

Re: Histogram
« Reply #43 on: 19 / January / 2013, 11:52:54 »
Lapser et al

I have explored the S95 and G11 through RawDigger and now 'understand' what is going on.

First, when I tried to use set_shot_meter(1,2,2,98,98) it returned an error (nil value). The other enhanced histo calls are working. Have I got the call right?

Anyway, to my observations:
•   In RawDigger I see three lines lines on the image, on the left, right and bottom edges, ie a ‘few’ pixels in from the edge. I assume these are the ‘dead’ areas that any RAW processing ignores?
•   According to the WB setting (I took images of a neutral wall) there is a spike of about 2000 in RawDigger at 127 or 128, it varies according to WB. This data seems to be there all the time.
•   Both the S95 and the G11 have these spikes around 127 and 128, even when I over expose the image, ie histogram way to the right.
•   There appears to 'always' be a spike at 4095, also about 2000 count in RawDigger, even when I underexpose and skew the histrogram way to the left.

And my work around is?

Well my script is an auto bracketing one and I wished to ensure I caught ‘all’ the highlights, even speculars. I believe I can work around the two spikes at 127/128 and 4095 by sampling above, say, 130, and 4094 and below. Data in this range (130 to 4094) should represent my image data.

I will also initially meter in the dark areas so that my script will only need to take one more bracket at that end. In other words, data at the high end of the histogram will be more stable, ie you know where you are at 4094 and below.

There remains the question as to why set_shot_meter(1,2,2,98,98) doesn’t work.

Bottom line: by exploring images with RawDigger I have concluded that if I restrict my histo_range counting, using Lapser’s functions, to between 130 (I may go higher for ‘safety’) and 4094, I should have a stable auto bracketing script (at least for my 12b S95 and G11).

BTW I have noticed that the G11 is much slower at running my script than the S95. Just an observation.

Cheers

Garry


Re: Histogram
« Reply #44 on: 19 / January / 2013, 13:15:26 »
Postscript

Just realised I need to use 4095 and below, else I wont 'measure' the overexposed correctly.

*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #45 on: 19 / January / 2013, 13:54:42 »
First, when I tried to use set_shot_meter(1,2,2,98,98) it returned an error (nil value). The other enhanced histo calls are working. Have I got the call right?
Oops! The actual call is:

shot_meter_enable(1,2,2,98,98)

I feel like an idiot, so that should fix the problem.
Quote

•   In RawDigger I see three lines lines on the image, on the left, right and bottom edges, ie a ‘few’ pixels in from the edge. I assume these are the ‘dead’ areas that any RAW processing ignores?
Sorry, that's something my program did for debugging. I write the metering areas into the raw file on the first shot, which show up as blown pixels in the first histogram. The work-around is to throw away one shot:

shot_histo_enable(1)
shoot() -- throw away shot with meter boundary lines

This post explains the metering boundary thing a little better:
http://chdk.setepontos.com/index.php?topic=8997.msg94890#msg94890
Quote
•   According to the WB setting (I took images of a neutral wall) there is a spike of about 2000 in RawDigger at 127 or 128, it varies according to WB. This data seems to be there all the time.
•   Both the S95 and the G11 have these spikes around 127 and 128, even when I over expose the image, ie histogram way to the right.
I think those could be the debug metering lines showing up too. I write 2 black level lines next to a white level line. If throwing away the first shot doesn't help, it may be the active area is too large.

I'm using the entire "active area" of the camera, as set in the camera specific data when the camera port is done.
All around the active area is a masked area that never gets any light. I suspect that the active area values may extend into the masked area a little, which would produce constant black level pixel counts in the histogram. See if shot_meter_enable(1,1,1,99,99) or shot_meter_enable(1,2,2,98,98) changes anything. I may need to shrink the  default full histogram area a little smaller than the active sensor area.
Quote
•   There appears to 'always' be a spike at 4095, also about 2000 count in RawDigger, even when I underexpose and skew the histrogram way to the left.
And my work around is?
This should only happen on the first shot after shot_histo_enable(1) if it's my program writing the meter areas in the raw file. I'll take this out, or make it an option, when I'm finished debugging the meters. In the meantime, throw away the first shot as described above.
Quote
BTW I have noticed that the G11 is much slower at running my script than the S95. Just an observation.
My G1X has the DIGIC 4, and is a little slower than the SX260 with the DIGIC 5 in my timing test. Sounds like the G11 must have the DIGIC -1 or something.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #46 on: 19 / January / 2013, 14:11:55 »
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.
Thanks for that info, Phil. I've been using the gui version of chdkptp which has an "advanced" transfer that unzips and transfers all the files, including modules. It also has a "basic" transfer for scripts. It would be easier just to run a CMD file, which is on my to do list.

Incidentally, I got the Toshiba Flashair cad, and there's no way to upload anything to the card from a computer as of now. It might be possible with the newer EyeFi cards. The FLashair does let you view CHDK log files, script files, etc. using any browser, as well as photos. You can monitor the camera, but not control it in any way. Toshiba promised upload capability, but it's not here yet.

But I think wireless cards will be extremely useful with CHDK in the near future. The hardware is ready now.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Histogram
« Reply #47 on: 19 / January / 2013, 15:01:25 »
Lapser

I note that using shot_meter_enable(1,2,2,98,98) moves the lines further into the image. That is the lines are still seen on the histogram ends.

As you say, they go away for subsequent images.

Also, when I open up the images in Lightroom, the lines on the first image can not be seen. But I can see them in RawDigger.

Will you be removing the lines from your calls? Or will I need to always work around the first image having the lines on.

Cheers

Garry


Re: Histogram
« Reply #48 on: 19 / January / 2013, 15:25:04 »
Lapser

I am now 100% convinced your get_histo_range(x, y,0) behaves differently on the S95 to the G11.

I get what I expect to see on the S95, ie the count is zero, when indeed there are no RAW data there, as checked in RawDigger.

On the G11, the same call seems to return a constant number in the 60 to 80 range when I use get_histo_range(127, 132,0). But I have confirmed in RawDigger that there is no data in this range.

I'm at a loss, but it seems your call works fine on the S95, but has this 'phantom noise' on the G11.

Cheers

Garry

*

Offline lapser

  • *****
  • 1093
Re: Histogram
« Reply #49 on: 19 / January / 2013, 15:34:22 »
Will you be removing the lines from your calls? Or will I need to always work around the first image having the lines
Attached are new builds with the lines removed.

I only draw the lines now if there is more than one meter, so I can have my lines, and you don't have to eat them too.

As for the difference on the G11, did you try shot_meter_enable(1,2,2,98,98) and see if it changes?

I gotta go now for the day. I'll check back tomorrow to see how you're doing.

[EDIT] Can someone check to see if the G11 active area is correct? Thanks.

Active area for S95
    #define CAM_ACTIVE_AREA_X1              64
    #define CAM_ACTIVE_AREA_Y1              22
    #define CAM_ACTIVE_AREA_X2              3728
    #define CAM_ACTIVE_AREA_Y2              2762

Active area for G11
    #define CAM_ACTIVE_AREA_X1              16
    #define CAM_ACTIVE_AREA_Y1              8
    #define CAM_ACTIVE_AREA_X2              3692
    #define CAM_ACTIVE_AREA_Y2              2776

« Last Edit: 19 / January / 2013, 15:42:09 by lapser »
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal