Skip to content
Snippets Groups Projects
Commit f73ccf27 authored by Markus Höschle's avatar Markus Höschle
Browse files

update function and comments

parent f90264ad
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ Function
"""
#
# First step is to list all the connected cameras at the system:
# list all the connected cameras at the system:
#
def listcam():
......@@ -42,7 +42,7 @@ def listcam():
listcam()
#
# Second step is open camara device
# open camara device
#
def opencam():
......@@ -57,12 +57,31 @@ def opencam():
#opencam()
#
# close camera interface
#
def closecam():
"""
close interface to camera
"""
# close camera
## camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())
print("closeDevice:", "\n")
return camera.Close()
#closecam()
#
# read parameters in camara
#
def readcam():
"""
read out current settings from camera via interface
"""
# open camera interface:
opencam()
# Read Gain value in Camera:
print("Gain in (dB):")
# Gain value
......@@ -73,28 +92,19 @@ def readcam():
# TriggerDelay value
print(camera.TriggerDelay.Value, "\n")
# for chaning the value uncomment the comment in the next line (camera.TriggerDelay.Value = YourValue)
#camera.TriggerDelay.Value = 0
# Exposure parameter
oldexposure = camera.ExposureTime.GetValue()
print(f'exposure: {oldexposure}',"\n")
oldfps = camera.AcquisitionFrameRate.GetValue()
print(f'fps: {oldfps}')
# Gamma value:
print("Camera gamma value: ")
print(camera.Gamma.GetValue(), "\n")
closecam()
#
# close camera interface
#
def closecam():
"""
close interface to camera
"""
# close camera
## camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())
print("closeDevice:", "\n")
return camera.Close()
#closecam()
readcam()
#
# Funktion for changing the value (uncomment the comment in the next line (camera.Gain = YourValue))
......@@ -104,8 +114,13 @@ def gaincam():
changes the gain in (dB)
"""
opencam()
gainvalue = input("Please enter the new gain in (dB): ")
camera.Gain = float(gainvalue)
# Read Gain value in Camera:
print(" Gain in (dB):")
# Gain value
print(camera.Gain.Value, "\n")
# Input new gain value
gainvalue = float(input("Please enter the new gain in (dB): "))
camera.Gain = (gainvalue)
# Read Gain value in Camera:
print("New Gain in (dB):")
# Gain value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment