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 ...@@ -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(): def listcam():
...@@ -42,7 +42,7 @@ def listcam(): ...@@ -42,7 +42,7 @@ def listcam():
listcam() listcam()
# #
# Second step is open camara device # open camara device
# #
def opencam(): def opencam():
...@@ -57,12 +57,31 @@ def opencam(): ...@@ -57,12 +57,31 @@ def opencam():
#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(): def readcam():
""" """
read out current settings from camera via interface read out current settings from camera via interface
""" """
# open camera interface: # open camera interface:
opencam() opencam()
# Read Gain value in Camera: # Read Gain value in Camera:
print("Gain in (dB):") print("Gain in (dB):")
# Gain value # Gain value
...@@ -73,28 +92,19 @@ def readcam(): ...@@ -73,28 +92,19 @@ def readcam():
# TriggerDelay value # TriggerDelay value
print(camera.TriggerDelay.Value, "\n") print(camera.TriggerDelay.Value, "\n")
# for chaning the value uncomment the comment in the next line (camera.TriggerDelay.Value = YourValue) # Exposure parameter
#camera.TriggerDelay.Value = 0 oldexposure = camera.ExposureTime.GetValue()
print(f'exposure: {oldexposure}',"\n")
oldfps = camera.AcquisitionFrameRate.GetValue()
print(f'fps: {oldfps}')
# Gamma value: # Gamma value:
print("Camera gamma value: ") print("Camera gamma value: ")
print(camera.Gamma.GetValue(), "\n") print(camera.Gamma.GetValue(), "\n")
closecam() closecam()
readcam()
#
# 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()
# #
# Funktion for changing the value (uncomment the comment in the next line (camera.Gain = YourValue)) # Funktion for changing the value (uncomment the comment in the next line (camera.Gain = YourValue))
...@@ -104,8 +114,13 @@ def gaincam(): ...@@ -104,8 +114,13 @@ def gaincam():
changes the gain in (dB) changes the gain in (dB)
""" """
opencam() opencam()
gainvalue = input("Please enter the new gain in (dB): ") # Read Gain value in Camera:
camera.Gain = float(gainvalue) 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: # Read Gain value in Camera:
print("New Gain in (dB):") print("New Gain in (dB):")
# Gain value # 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