Commit 3431a260 authored by augustin_s's avatar augustin_s 🐍
Browse files

added methods to get the image, width and height

parent 4c6101a1
......@@ -77,6 +77,29 @@ class CameraClient:
def clear_buffer(self):
caput(self.name + ":CLEARMEM", 1) # Clear Buffer
def width(self):
res = caget(self.name + ":WIDTH")
if res is None:
raise RuntimeError("Could not caget width")
return int(res)
def height(self):
res = caget(self.name + ":HEIGHT")
if res is None:
raise RuntimeError("Could not caget height")
return int(res)
def get(self):
waveform = caget(self.name + ":FPICTURE")
if waveform is None:
raise RuntimeError("Could not caget waveform")
width = self.width()
height = self.height()
length = width * height
waveform = waveform[:length]
image = waveform.reshape(height, width)
return image
def get_max_roi(self):
current_roi = self.get_roi()
self.reset_roi()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment