looking for help with Neutral Density Filter and scripting - Script Writing - CHDK Forum  

looking for help with Neutral Density Filter and scripting

  • 4 Replies
  • 4440 Views
looking for help with Neutral Density Filter and scripting
« on: 29 / April / 2012, 15:34:32 »
Advertisements
CHDK has two scripting functions for use with a camera's ND filter.  You can determine your camera configuration with  get_nd_present() - returns 0 if the camera does not have an ND filter, 1 if the camera has only an ND filter and 2 if the camera has an ND filter and a diaphragm.   And you can change the position of the ND filter with set_nd_filter(n) - n=0 for auto, n=1 for filter in,  n=2 for filter out

However, there does not seem to be a way to determine the current position of the filter.  There is are propcases defined that should tell the state but apparently only in M mode (assuming your camera even has one). In P and Auto modes the value never changes.

Furthermore,  if you manually set the filter state, the filter does not move in until just before the shot, and after the exposure has been set.  For example :

Code: [Select]
set_nd_filter(1)
press("shoot_half")
repeat sleep(100) until get_shooting() == true
click("shoot_full")
release("shoot_half")
repeat sleep(100) until get_shooting() == false

set_nd_filter(2) 
press("shoot_half")
repeat sleep(100) until get_shooting() == true
click("shoot_full")
release("shoot_half")
repeat sleep(100) until get_shooting() == false

produces two photos with very different exposure ( the first is much darker than the second).

Does anyone have any pointers for working with the ND filter that I might have missed.   I'm playing with bracketing modes and trying to figure out how to either lock the ND filter in one state or how to understand what it does when in automatic modes.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14118
Re: looking for help with Neutral Density Filter and scripting
« Reply #1 on: 29 / April / 2012, 16:30:16 »
Overrides are generally not taken into account by the Canon auto exposure, so what you describe is expected behavior. If you force ND on or off you should adjust one of the other parameters to compensate... but unfortunately you don't know whether Canon auto exposure would have used it, so that basically requires you to set all parameters.

For cameras without a real adjustable aperture at least, you can work out the ND state from the Av props.

I've attached an intervalometer script I wrote a while ago that attempts to do override ND intelligently. It's been a long time since I looked at this, so I'm not sure what state it's in. The script was written for SD990, and has some hardcoded stuff that probably isn't need these days.
Don't forget what the H stands for.

Re: looking for help with Neutral Density Filter and scripting
« Reply #2 on: 29 / April / 2012, 16:58:35 »
Overrides are generally not taken into account by the Canon auto exposure, so what you describe is expected behavior. If you force ND on or off you should adjust one of the other parameters to compensate... but unfortunately you don't know whether Canon auto exposure would have used it, so that basically requires you to set all parameters.
That's how I got here - set_av96() set_tv96() and set_sv96() seemed to cover everything except the position of the ND filter.

Quote
For cameras without a real adjustable aperture at least, you can work out the ND state from the Av props.
So I think what you are suggesting is "guessing" the state of the ND filter by seeing if get_bv96() = get_tv96() + get_sv96() - get_sv96()  ? (within some suitable accuracy value)

Quote

I've attached an intervalometer script I wrote a while ago that attempts to do override ND intelligently. It's been a long time since I looked at this, so I'm not sure what state it's in. The script was written for SD990, and has some hardcoded stuff that probably isn't need these days.
553 lines .. thanks,  I think :)

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14118
Re: looking for help with Neutral Density Filter and scripting
« Reply #3 on: 29 / April / 2012, 17:31:01 »
Quote
For cameras without a real adjustable aperture at least, you can work out the ND state from the Av props.
So I think what you are suggesting is "guessing" the state of the ND filter by seeing if get_bv96() = get_tv96() + get_sv96() - get_sv96()  ? (within some suitable accuracy value)
No. For cameras with ND only, there's only two possible Av for a given zoom, and there is a propcase that gives you the minimum possible Av for the current zoom. I've never had an ND+iris cam, so I don't know what the deal is with those.

Quote

553 lines .. thanks,  I think :)
The relevant stuff is only ~120 lines starting around 404 ;)
Don't forget what the H stands for.


Re: looking for help with Neutral Density Filter and scripting
« Reply #4 on: 29 / April / 2012, 17:47:12 »
No. For cameras with ND only, there's only two possible Av for a given zoom, and there is a propcase that gives you the minimum possible Av for the current zoom. I've never had an ND+iris cam, so I don't know what the deal is with those.
I'll look at that - thanks.  I tried instrumenting the script I posted above with calls to all 4 get_*v() commands after every step.  The values were the same regardless of whether I overrode the ND filter in or out.  Frustrating.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal