Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
Because of un-manageable amounts of spam despite our use of CAPTCHAs, email authorization, and other tools, we have discontinued this forum (see the 700k+ registered users with validated email addresses at right?). Please email us any questions or post bug reports and feature requests on GitHub at https://github.com/jevois -- The content below remains available for future reference.
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, 2019 in Programmer Questions by hortplus (260 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, 2019 by JeVois (46,580 points)