def getImageDescription(self, current=None): self.imageData = jderobot.ImageDescription() img = self.camera.get_image() self.imageData.width = img.shape[1] self.imageData.height = img.shape[0] self.format = 'RGB' return self.imageData
def getData(self): img = self.camera.get_image() self.imageData = jderobot.ImageData() self.imageData.description = jderobot.ImageDescription() self.imageData.description.width = img.shape[1] self.imageData.description.height = img.shape[0] self.imageData.description.format = 'RGB8' self.pixelData = np.getbuffer(img) self.imageData.pixelData = self.pixelData return True
def getImageDescription(self, current=None): self.imageData = jderobot.ImageDescription() if os.path.isfile('./image.jpg'): try: self.image = Image.open('./image.jpg', 'r') self.imageData.width = self.image.width self.imageData.height = self.image.height self.image.close() except: self.imageData.width = 640 self.imageData.height = 360 self.format = 'RGB' return self.imageData