proposal - script shooting hooks - page 6 - General Discussion and Assistance - CHDK Forum supplierdeeply

proposal - script shooting hooks

  • 290 Replies
  • 108099 Views
*

Offline c_joerg

  • *****
  • 1248
Re: proposal - script shooting hooks
« Reply #50 on: 26 / February / 2015, 03:01:00 »
Advertisements
Hallo,

I have used the S110.

Quote
Very nice video,

Yes, thanks, one of my first ones.  But unfortunately too much Overexposure and I don’t like the turbulent waves. The waves have to smooth with longer Tv values.
 
Quote
The exposure calculation is only supposed to increase ISO if the shutter speed goes below "ISO adj Tv Sec/100".

That is what I expect.

Quote
Note that the default "Target ISO" is 80, but some cameras only go down to 100.

ISO 80 is my camera default for time –laps to get longer Tv values. That is also what I found in the first Picture of EXIF Data. I have never changed it, also not in Scripts. I will run the isobase.lua to see what I get on the S110.

May be some other interesting thing: Another default on my cam is, that I switch always the ND Filter on, to get longer Tv values. But you work on the RAW Buffer. This should not have an influence on your control or?


Quote
If your camera has the ISO base bug, it would cause bad overexposure.

Ok, for the first pictures, but then you use the RAW Buffer and you don’t look about the ISO value anymore or?


Quote
In my script, the Overexp Ev range is the range of values (in exposure stops) treated as over exposure.
If you increase this, you can trigger over exposure protection before the pixels are actually saturated.

OK, default was ¼. Maybe I go to ½ or 1. But I don’t think it helps for the moon, because there is a big jump from the moon to the background. Maybe zero on ui_exp_over_thresh_pct ist not absolute 0 assorted 0.1% or 0.01%.
 

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

*

Offline c_joerg

  • *****
  • 1248
Re: proposal - script shooting hooks
« Reply #51 on: 26 / February / 2015, 03:05:34 »
Here is the log file. It’s a really got idea to have logged al this information…  :)
S110 ==> CAM_MARKET_ISO_BASE 200
« Last Edit: 26 / February / 2015, 10:31:08 by c_joerg »
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

*

Offline reyalp

  • ******
  • 14082
Re: proposal - script shooting hooks
« Reply #52 on: 26 / February / 2015, 16:31:20 »
Here is the log file. It’s a really got idea to have logged al this information…  :)
S110 ==> CAM_MARKET_ISO_BASE 200
Thanks for confirming. I've checked the change in for both the trunk and 1.3

At one point, having ISO_BASE wrong resulted in a feedback loop, but I think the current code doesn't do that, so it may not explain the over-exposure problems.

The logs are very helpful to see what the code is doing. Most of the fields relevant to the exposure calculation are documented in the readme.

In your log, the under_weight 200 shows that under exposure protection was maxed out. Over exposure protection was triggered too, but not maxed out, so the net result was a positive ev shift of ~1 stop.

You can make under exposure protection less aggressive by increasing "Underexp -Ev" and/or "Underexp Thresh %". The default value for -Ev may be high, there was a bug in this area for a while.

There isn't currently a way to adjust the relative priority of under/over protection. This is done in exp:calc_ev_change() if you want to play with the code.

The sv 380 != cam 476 lines show the ISO_BASE bug, but I don't think this ends up affecting the overall exposure.

I would be interested to see the output from drtest.lua on your cameras. This is included in the scripts/test directory of the 1.4 packages. To use it, aim the camera at a neutral subject with constant lighting, and run the script. The default settings should be OK. It outputs to drtest.csv and on the images. I only need the csv, but the images may help if something is weird.

Quote
OK, default was ¼. Maybe I go to ½ or 1. But I don’t think it helps for the moon, because there is a big jump from the moon to the background. Maybe zero on ui_exp_over_thresh_pct ist not absolute 0 assorted 0.1% or 0.01%.
This is a good point, I'll have to do some experimenting and see how it behaves. Up to now, I've mostly been thinking in terms of ignoring the sun or moon and having the rest of the correctly exposed.

Currently the new histogram code only works in 0.1% increments, but perhaps this is an argument for greater precision.

The over exposure protection actually ramps in below the specified percent. If the "ramp in" range doesn't have enough precision, you end up with flickering as at flaps between values.
Don't forget what the H stands for.

*

Offline c_joerg

  • *****
  • 1248
Re: proposal - script shooting hooks
« Reply #53 on: 27 / February / 2015, 03:20:54 »
Hallo,

Quote
At one point, having ISO_BASE wrong resulted in a feedback loop, but I think the current code doesn't do that, so it may not explain the over-exposure problems.

I make a new test with Overexposure 1%, but still with wrong ISO_BASE.  So maybe you can ignore this. Basically Overexposure works fine. I analyzed the pictures, correct it with factor from 4:3 to 16:9 and I got mostly 1%. But from one point it starts to increase…
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


*

Offline c_joerg

  • *****
  • 1248
Re: proposal - script shooting hooks
« Reply #54 on: 27 / February / 2015, 06:24:32 »
Hallo,

Quote
You can make under exposure protection less aggressive by increasing "Underexp -Ev" and/or "Underexp Thresh %".

Doe it makes any problems when I switch it totally off? It reduces the number of rules. I would prefer when the time laps goes darker to the night. Underexposure can be also better corrected in post processing.

I did not really understood, how Underexposure works.
My understanding of your algorithms is: You try to get the box in the middle to a neutral value. If there is no Over or Underexposure every think is OK. If you have Overexposure than this has a higher priority or? But what is when you have Underexposure at the same time? May be Underexposure switching off makes understanding easier.

Quote
The sv 380 != cam 476 lines show the ISO_BASE bug

So I will update CHDK…

Quote
I would be interested to see the output from drtest.lua on your cameras

I´ll try to run it on the weekend…


Do you know dslrdashboard?

I use it sometimes to make time laps with my EOS1200. In the Module LRTimelapse they transfer pictures via WLAN or USB to a host (Tablet or PC). Then they are calculating some floating average and a Histogram. With the result, they control the DSLR. For sunset they also increasing Tv values first, and on the minimum Tv value they increase ISO to a maximum value (Max Tv and ISO adj Tv is the same). I never had much over-exposure problems with this program, so they must also have a protection. It is interesting to study the ’ lrtimelapse holy grail tutorial’.
« Last Edit: 27 / February / 2015, 07:22:01 by c_joerg »
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

*

Offline reyalp

  • ******
  • 14082
Re: proposal - script shooting hooks
« Reply #55 on: 27 / February / 2015, 16:38:31 »
Doe it makes any problems when I switch it totally off?
You can't actually turn it off, but if you set the margin to -7 it will only count pixels near black level as under exposed, and you could increase the % to 100. I think this would be pretty close to disabling it, but as I mentioned earlier, the current logic ramps in before the thresh % is reached.

Edit: Actually, you should be able to turn it of by setting Thresh % to 0.

Note that the "Meter low thresh" and "Meter low limit" discussed below also have an influence, and will eventually cancel out over exposure protection.

Quote
My understanding of your algorithms is: You try to get the box in the middle to a neutral value.
Or an ev shift if you've specified one.
Quote
If there is no Over or Underexposure every think is OK. If you have Overexposure than this has a higher priority or? But what is when you have Underexposure at the same time?
Over, under and the box each have a "weight" that controls the contribution to the final exposure. For over and under, the weight is based on square of the fraction of the threshold %.

This means that if values are much less than the threshold, the has a very small contribution, and if it's larger it has a very big contribution. The slope of these quadratics are modified so that over-exposure has more weight for a given fraction. (The /120 and /150 in the code mentioned earlier)

The box also has a quadratic behavior: As the average value is pushed past the limits defined by Meter high thresh Ev and Meter low thresh Ev, the weight is increased based on the fraction of corresponding "limit ev" reached.

The base weight for the box is 100, and all the weights are limited to 200.

The actual change in exposure is based on the combined weights, limited by Max Ev Change. So if both over and under are maxed out, they will cancel out. If over exposure is high, but meter has been pushed far below "Meter low limit", they will balance out.

The reason behind all of this is to vary the exposure smoothly between the different limits, with emphasis on keeping the meter area at a "reasonable" exposure.

Note that this is all a work in progress, and was mainly written to test the C code and provide an example of using the new fatures. I'm open to bug reports and improvements!

The exposure code is quite modular. You should be able replace exp:calc_ev_change with pretty much any logic you want as long as sets self.ev_change at the end (you also need to do something with the code at the top which ensures self.ev_target is set on the first iteration)


Quote
I would prefer when the time laps goes darker to the night.
This is currently something my script does not do well, since it always tries to maintain the target exposure at a fixed value. Things only get darker once you hit the shutter and ISO limits.

My idea to handle is adding an option to make the target Ev vary proportional to the absolute brightness of the scene. So for example, your initial shot would be neutral, and every stop of actual brightness would change the target exposure by say 0.1 stop.
« Last Edit: 27 / February / 2015, 16:52:48 by reyalp »
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14082
Re: proposal - script shooting hooks
« Reply #56 on: 27 / February / 2015, 16:51:55 »
I make a new test with Overexposure 1%, but still with wrong ISO_BASE.  So maybe you can ignore this. Basically Overexposure works fine. I analyzed the pictures, correct it with factor from 4:3 to 16:9 and I got mostly 1%. But from one point it starts to increase…
The under exposure fraction is very high, and the under_weight is hitting 200.

If your scene doesn't actually have big dark areas, there might be some other problem. If the raw active area isn't defined correctly, it could include a lot of masked pixels or something like that. If you can upload a sample DNG somewhere, that might be helpful.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14082
Re: proposal - script shooting hooks
« Reply #57 on: 28 / February / 2015, 18:08:57 »
Updated scripts
Add shots=0 for unlimited as suggested by c_joerg.

Added "Bv Ev shift %" option, based on the idea I posted earlier. This shifts the target exposure as a percentage of the difference between the Bv value of the fist shot and the most recent meter. So if you set this to 50 and the scene brightness changes by 1 stop, the target exposure will change by 1/2 stop. Setting to 0 gives you the old behavior of always targeting a specific value.

This shift is applied on top of any specified Ev shift.

Note that this is based on the first exposure, because it was easy and I didn't come up with a convenient way of expressing it in absolute terms. For a sunset, it would automatically make the scene start out normally exposed and get progressively darker. For a sunrise to start dark and brighten to "normal" you would need to start with a negative Ev shift.

The shift is subject to the limits set by "Meter high thresh Ev" etc. (edit: nope, buggy in current implementation) Indicators for these values are added to the debug overlay. Note that these limits are relative to any initial Ev shift specified in the "Ev shift" or "Use initial Ev as target".

I haven't tested this extensively yet.

contae.lua is updated to use the new exposure module code, but the Bv Ev shift is hard code to 0 and other than logging, the script is unchanged.
« Last Edit: 28 / February / 2015, 22:05:53 by reyalp »
Don't forget what the H stands for.


*

Offline c_joerg

  • *****
  • 1248
Re: proposal - script shooting hooks
« Reply #58 on: 01 / March / 2015, 06:26:22 »
Hello,
I have a busy weekend, could not much do…

Update CHDK and 380 != cam 476 is gone…

Then I run drtest.lua, but it seems that there is not much information. The S110 makes 5 pictures, G1X just 3. It looks like, there was an exception but I haven’t had the time to find out…

Ok, upload from DNG is to much. Can I try to send on the EMail which is in the LUA Script?
« Last Edit: 01 / March / 2015, 06:56:16 by c_joerg »
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

*

Offline c_joerg

  • *****
  • 1248
Re: proposal - script shooting hooks
« Reply #59 on: 01 / March / 2015, 12:22:19 »
Quote
Note that this is all a work in progress, and was mainly written to test the C code and provide an example of using the new fatures. I'm open to bug reports and improvements!

Of course….

Quote
If your scene doesn't actually have big dark areas, there might be some other problem.

Pictures against the sun have mostly big dark areas. But when you don`t want to have to much Overexposure, you must let them dark. Yes this scene has big dark areas….
Pictures against the sun are the difficults ones. I think for this condition, Underexposure has to be ignored. I will try it the next time.

I not sure, if it make sense, to move the box also up and down. May be on sun set or rise to move the box to the sky.
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

 

Related Topics