Skip to content

Add control of autoexposure lighting and metering#58

Open
IanButterworth wants to merge 2 commits into
samuelpowell:masterfrom
IanButterworth:autoexposure_metering
Open

Add control of autoexposure lighting and metering#58
IanButterworth wants to merge 2 commits into
samuelpowell:masterfrom
IanButterworth:autoexposure_metering

Conversation

@IanButterworth
Copy link
Copy Markdown
Collaborator

@IanButterworth IanButterworth commented Oct 30, 2019

This isn't working for me, but it may be a camera support issue, given neither AutoExposureLightingMode nor AutoExposureMeteringMode are present in spinview for my camera.

  autoexposure_lighting_mode!(::Camera, mode::String)

  Change autoexposure lighting mode.
  Options:
  - "AutoDetect": Automatically detect
  - "Backlight": Used when a strong light is coming from the back of the object.
  - "Frontlight": Used when a strong light is shining in the front of the object
                  while the background is dark.
  - "Normal": Used when the object is not under backlight or frontlight conditions
  autoexposure_metering_mode!(::Camera)

  Change autoexposure lighting mode to "Normal" and set the autoexposure metering mode.
  Options:
  - "Average": Measures the light from the entire scene uniformly to determine
                the final exposure value. Every portion of the exposed area has
                the same contribution.
  - "Spot": Measures a small area (about 3%) in the center of the scene while
                the rest of the scene is ignored. This mode is used when the
                scene has a high contrast and the object of interest is relatively
                small.
  - "Partial": Measures the light from a larger area (about 11%) in the center
                of the scene. This mode is used when very dark or bright regions
                appear at the edge of the frame.
  - "CenterWeighted": (No SDK docs)
  - "HistgramPeak": (No SDK docs)

@IanButterworth IanButterworth changed the title Add control of autoexposure and lighting metering Add control of autoexposure lighting and metering Oct 30, 2019
@IanButterworth
Copy link
Copy Markdown
Collaborator Author

@samuelpowell
Copy link
Copy Markdown
Owner

Okay in principle but how do I test this? Does it fail gracefully on an unsupported camera?

@IanButterworth
Copy link
Copy Markdown
Collaborator Author

It gives a spinnaker handle error for me

@samuelpowell
Copy link
Copy Markdown
Owner

Okay will check this when I'm in front of a camera

@samuelpowell
Copy link
Copy Markdown
Owner

Does the below match your expectations?

julia> autoexposure_lighting_mode!(cam1, "AutoDetect")
ERROR: Node AutoExposureLightingMode entry is not readable
Stacktrace:
 [1] set!(::Spinnaker.SpinEnumNode, ::String) at /Users/spowell/.julia/dev/Spinnaker/src/Nodes.jl:179
 [2] autoexposure_lighting_mode!(::Camera, ::String) at /Users/spowell/.julia/dev/Spinnaker/src/camera/acquisition.jl:164
 [3] top-level scope at REPL[7]:1

julia> autoexposure_lighting_mode!(cam1, "Backlight")
"Backlight"

julia> autoexposure_lighting_mode!(cam1, "Frontlight")
"Frontlight"

julia> autoexposure_lighting_mode!(cam1, "Normal")
"Normal"

julia> autoexposure_metering_mode!(cam1, "Average")
"Average"

julia> autoexposure_metering_mode!(cam1, "Spot")
"Spot"

julia> autoexposure_metering_mode!(cam1, "Partial")
"Partial"

julia> autoexposure_metering_mode!(cam1, "CenterWeighted")
ERROR: Node AutoExposureMeteringMode entry is not readable
Stacktrace:
 [1] set!(::Spinnaker.SpinEnumNode, ::String) at /Users/spowell/.julia/dev/Spinnaker/src/Nodes.jl:179
 [2] autoexposure_metering_mode!(::Camera, ::String) at /Users/spowell/.julia/dev/Spinnaker/src/camera/acquisition.jl:191
 [3] top-level scope at REPL[14]:1

julia> autoexposure_metering_mode!(cam1, "HistgramPeak")
ERROR: Node AutoExposureMeteringMode entry is not readable
Stacktrace:
 [1] set!(::Spinnaker.SpinEnumNode, ::String) at /Users/spowell/.julia/dev/Spinnaker/src/Nodes.jl:179
 [2] autoexposure_metering_mode!(::Camera, ::String) at /Users/spowell/.julia/dev/Spinnaker/src/camera/acquisition.jl:191
 [3] top-level scope at REPL[15]:1

julia> autoexposure_metering_mode!(cam1, "HistogramPeak")
┌ Error: Metering mode "HistogramPeak" not recognized
└ @ Spinnaker ~/.julia/dev/Spinnaker/src/camera/acquisition.jl:193

julia> autoexposure_metering_mode!(cam1, "Average")
"Average"

@IanButterworth
Copy link
Copy Markdown
Collaborator Author

It looks like the node names are recognized for your camera (which they aren’t for me) but that their function is locked because of another setting that needs to be switched first. Partial success. I’ll try to figure out which setting is blocking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants