JeVois Tutorials
1.22
JeVois Smart Embedded Machine Vision Tutorials
|
|
Many machine vision modules running on JeVois send messages over serial port (either the hardware 4-pin connector, or the serial-over-USB port) to indicate what they have found (e.g., detected ArUco marker IDs, decoded QR-Code contents, identified TensorFlow objects).
In this tutorial, we will write a simple Python program to read and parse the messages sent by JeVois over serial.
setpar serout USB setpar serstyle Normalto instruct JeVois to send any detections to the serial-over-USB port, and to use the Normal standardized message format.
N2 id x y w h
N2 U18 -322 -369 444 419 N2 U5 352 259 434 450 N2 U43 -358 228 459 456 N2 U12 367 -323 416 428 N2 U18 -317 -363 441 425 N2 U5 380 288 428 463 N2 U43 -333 256 453 463 N2 U12 391 -303 413 425 N2 U18 -294 -342 438 428
sudo apt install python-serial
serdev
in the Python code to be the name of the serial port for your JeVois camera: same name as you use with your serial terminal program; typically:received: received: received: received: received: received: N2 U48 -203 220 356 353 Found ArUco U48 at (-203,220) size 356x353 received: N2 U48 -209 233 356 359 Found ArUco U48 at (-209,233) size 356x359 received: N2 U48 -52 253 366 369 Found ArUco U48 at (-52,253) size 366x369 received: N2 U48 11 269 359 369 Found ArUco U48 at (11,269) size 359x369 received: N2 U48 84 253 363 363 Found ArUco U48 at (84,253) size 363x363
Note how the empty "received:" statements are because we have a chosen timeout of 1 second when opening the serial port, and JeVois was not looking at any ArUco for the first 5 seconds of this example.
If you see nothing, review this:
setmapping2
, did you also send a streamon
?setpar serout USB
issued (if listening to the serial-over-USB), or setpar serout Hard
(if listening to the 4-pin port)?