def capture(): nivision.IMAQdxGrab(id, img, 1) picture = nivision.imaqImageToArray(img) data = struct.unpack(fmt, picture[0]) data = np.asarray(data) data = np.reshape(data, (cam_y, cam_x)) return data
def getImage(self, image): with self.mutex: if self.needSettingsUpdate or self.useJpeg: self.needSettingsUpdate = False self.useJpeg = False self.updateSettings() #t0 = time.time() nivision.IMAQdxGrab(self.id, image, 1)
def grab(self, waitForNextBuffer=True): nv.IMAQdxGrab(self.imaqdx, self.img, waitForNextBuffer=waitForNextBuffer) return self._decode_image_data(self.img)