Skip to content

Commit

Permalink
Update demo aquisition
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelldls committed Jun 24, 2024
1 parent b277047 commit 388733a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/genicam_fastcs/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
# CAMERA_SERIAL = "50-0536906292" # Camera product model
# CAMERA_SERIAL = "50-0503346450" # Camera product model
CAMERA_SERIAL = "17497407" # Camera product model
FPS = 155 # 32
FPS = 120 # 32
OUTPUT = "RESULT" # video name (without extension)
N_FRAMES = 100
N_FRAMES = 120
CHANNELS = 1
GAIN = 30


class GenICamNotFoundError(Exception):
Expand Down Expand Up @@ -48,8 +49,7 @@ def __init__(self):
else:
self.ia.remote_device.node_map.AcquisitionFrameRateAbs.value = FPS

self.ia.remote_device.node_map.Gain.value = 20
self.ia.start() # start image acquisition
self.ia.remote_device.node_map.Gain.value = GAIN

def _print_link_info(self, key, value):
dev_parent = None
Expand Down Expand Up @@ -77,13 +77,15 @@ def run(self, output):

# Store frames in RAM
start_time = datetime.now()
self.ia.start() # start image acquisition
for i in range(N_FRAMES):
with self.ia.fetch(timeout=3) as buffer:
frames[i] = buffer.payload.components[0].data.reshape(
buffer.payload.components[0].height,
buffer.payload.components[0].width,
# CHANNELS,
)
self.ia.stop() # stop image acquisition
delta_t = (datetime.now() - start_time).total_seconds()

expected_t = N_FRAMES / FPS
Expand Down Expand Up @@ -140,7 +142,6 @@ def list_attributes(self):
return self._list_children(map, "value")

def __del__(self):
self.ia.stop() # stop image acquisition
self.ia.destroy()
self.h.reset() # Needed? Need to add .update to init?

Expand Down

0 comments on commit 388733a

Please sign in to comment.