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.

headless not sending serial messages

0 votes

Hi.

I have a python module working that I just entered over the top of JeVois PythonTest 640x480 @ 15fps using JeVois-Inventor. The program simply sends the serial message "TARGET" when it spots the target using some funky OpenCV code.  The program is working great.  I have created the processNoUSB function as well and have test it successfully in headless mode; I can see "TARGET" coming through the USB interface.

Needless to say to do this, I had to set the initscript.cfg to

setmapping2 YUYV 320 264 30.0 JeVois PythonTest
setpar serout USB
streamon

However it is slightly slow so I have copied the python module to PyClassificationDNN 320 x 264 @ 30fps.  I was sure to rename the module to "PyClassificationDNN" from "PythonTest" in the code.  It works even better than the first version with an insane frame rate and lots of serial messages appearing in the log.

To test it in headless mode I changed the initscript.cfg to 

setmapping2 YUYV 320 264 30.0 JeVois PyClassificationDNN
setpar serout USB
streamon

I then went into headless mode and this is my problem.  The serial messages do not appear in the log window in headless mode in PyClassificationDNN but they do in PythonTest even though they are the same program.

I am very confused.

Interestingly, the user interface says at the top right "Supports mappings with NO USB output: Yes" for PythonTest but it says "Supports mappings with NO USB output: No" for PyClassificationDNN.  Could this have something to do with it? Where does this setting come from?  (I do note http://jevois.org/qa/index.php?qa=2291&qa_1=wrote-first-machine-vision-module-support-mapping-output-wrong which says that this not working as at 2018 and it should be ignored).

Thanks in advance!

Regards

Dave A



asked Sep 10, 2019 in Programmer Questions by DaveA (290 points)

1 Answer

+2 votes
 
Best answer
oh, in setmapping2, since you will go headless, you only specify the camera sensor resolution, and you have no video output resolution.

So you should use 320 240 for your resolution (camera sensor resolution), not 320 264 (which would be an output resolution to stream to USB). The sensor does not support 320x264 capture and hence your setmapping2 probably fails on boot up.

I am guessing you have already seen http://jevois.org/tutorials/UserHeadless.html

Now for PyClassificationDNN, indeed we did not write processNoUSB(), so you would need to write it by just taking process() and stripping out anything that has to do with drawing an output image.
answered Sep 10, 2019 by JeVois (46,580 points)
selected Sep 12, 2019 by DaveA
I realise now that I should have just gone and created a new module from the menu in JeVois Inventor. All working great now.
...