I am more confortable using OpenCV API, so sometime I need to change frame provided by jevois camera with OpenCV and send it over USB. But it does not work as I am trying to do it.
To reproduce issue, I took PythonTest example, and I changed it little bit.
def process(self, inframe, outframe):
jevois.LINFO("process with usb")
# Get the next camera image (may block until it is captured):
inimg = inframe.get()
jevois.LINFO("Input image is {} {}x{}".format(jevois.fccstr(inimg.fmt), inimg.width, inimg.height))
# Get the next available USB output image:
outimg = outframe.get()
jevois.LINFO("Output image is {} {}x{}".format(jevois.fccstr(outimg.fmt), outimg.width, outimg.height))
# Example of getting pixel data from the input and copying to the output:
jevois.paste(inimg, outimg, 0, 0)
# We are done with the input image:
inframe.done()
# Example of in-place processing:
jevois.hFlipYUYV(outimg)
img = jevois.convertToCvRGB(outimg)
# Example of simple drawings:
cv2.circle(img,
(int(outimg.width/2), int(outimg.height/2)),
int(outimg.height/2.2),
int(outimg.height/2.2))
# jevois.drawCircle(outimg, int(outimg.width/2),
# int(outimg.height/2), int(outimg.height/2.2),
# 2, jevois.YUYV.White)
jevois.writeText(outimg, "Hi from Python!", 20, 20, jevois.YUYV.White, jevois.Font.Font10x20)
# We are done with the output, ready to send it to host over USB:
outframe.sendCvRGB(img)
# Send a string over serial (e.g., to an Arduino). Remember to tell the JeVois Engine to display those messages,
# as they are turned off by default. For example: 'setpar serout All' in the JeVois console:
jevois.sendSerial("DONE frame {}".format(self.frame));
self.frame += 1
Regards