2 if pyjevois.pro:
import libjevoispro
as jevois
3 else:
import libjevois
as jevois
32 jevois.LINFO(
"PythonTest Constructor")
39 jevois.LINFO(
"PythonTest JeVois init")
44 self.
cx = jevois.Parameter(self,
'cx',
'int',
"Circle horizontal center, in pixels", 320, pc)
45 self.
cy = jevois.Parameter(self,
'cy',
'int',
"Circle vertical center, in pixels", 240, pc)
46 self.
radius = jevois.Parameter(self,
'radius',
'byte',
"Circle radius, in pixels", 50, pc)
51 jevois.LFATAL(
"process no usb not implemented")
59 jevois.LINFO(
"Input image is {} {}x{}".format(
jevois.fccstr(inimg.fmt), inimg.width, inimg.height))
62 outimg = outframe.get()
64 jevois.LINFO(
"Output image is {} {}x{}".format(
jevois.fccstr(outimg.fmt), outimg.width, outimg.height))
67 jevois.paste(inimg, outimg, 0, 0)
73 jevois.hFlipYUYV(outimg)
77 jevois.writeText(outimg,
"Hi from Python!", 20, 20, jevois.YUYV.White, jevois.Font.Font10x20)
79 jevois.drawCircle(outimg, self.
cx.get(), self.
cy.get(), self.
radius.get(), 2, jevois.YUYV.White)
86 if self.
frame % 100 == 0:
87 jevois.sendSerial(
"DONE frame {}".format(self.
frame));
94 idle, winw, winh = helper.startFrame()
97 x, y, w, h = helper.drawInputFrame(
"c", inframe,
False,
False)
106 helper.drawCircle(self.
cx.get(), self.
cy.get(), self.
radius.get(), 0xffffffff,
True)
109 fps = self.
timer.stop()
110 helper.iinfo(inframe, fps, winw, winh);
118 jevois.LINFO(
"parseserial received command [{}]".format(str))
121 return "ERR Unsupported command"
127 return "hello - print hello using python"
132 return "Hello from python!"
137 jevois.LINFO(
"PythonTest JeVois uninit")