Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

Image from command line

0 votes
Is there any way to use the command line interface to show ASCII values of the current image? I want to connect to an Arduino Uno which is connected to a SIM900 shield. I hope to be able to transfer the image to a web folder
asked Jan 2 in Programmer Questions by hortplus (240 points)

1 Answer

+1 vote

Yes, you would write a small python module that runs on jevois and simply:

- get the next image as a numpy array in your process() function

- in there, just loop over the pixels and issue a bunch of jevois.sendSerial() commands to send the values over the serial port

have a look here to get started:


in this code:

import libjevois as jevois

import cv2

import numpy as np

class Hello:

  def process(self, inframe, outframe):

    img = inframe.getCvBGR()


you would implement that looping over pixels and sending the serial messages using jevois.sendSerial() before the last sendCv() line.

examples of jevois.sendSerial() are here: http://jevois.org/tutorials/ProgrammerInvSerial.html

Note that at this point you would still be streaming video. Once this works in the inventor, you would convert your code to headless by implementing a processNoUSB() function with essentially the same code as in process() except no sendCv() line at the end. See http://jevois.org/tutorials/UserHeadless.html for more info about headless mode.

answered Jan 4 by JeVois (34,860 points)