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.
We have moved to a new forum at http://jevois.usc.edu, please check it out. The forum at jevois.org/qa will not allow new user registrations but is maintained alive for its useful past questions and 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, 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:

http://jevois.org/tutorials/ProgrammerInvHello.html

in this code:

import libjevois as jevois

import cv2

import numpy as np

class Hello:

  def process(self, inframe, outframe):

    img = inframe.getCvBGR()

    outframe.sendCv(img)

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)
...