Only measure sharpness if camera has "array" method
This commit is contained in:
parent
20bbf5ab21
commit
b4e2d5b172
1 changed files with 2 additions and 1 deletions
|
|
@ -144,7 +144,8 @@ def sharpness_edge(image):
|
|||
|
||||
def measure_sharpness(microscope, metric_fn=sharpness_sum_lap2):
|
||||
"""Measure the sharpness of the camera's current view."""
|
||||
return metric_fn(microscope.camera.array(use_video_port=True))
|
||||
if hasattr(microscope.camera, "array"):
|
||||
return metric_fn(microscope.camera.array(use_video_port=True))
|
||||
|
||||
|
||||
def autofocus(microscope, dz, settle=0.5, metric_fn=sharpness_sum_lap2):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue