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.

Convert module to “Supports mappings with NO USB output: YES”

0 votes
I’d like to use the “Demo Saliency” module in an Arduino project but the module does NOT support mappings with NO USB.

What should I do to have a copy of this module that is able to run without USB? (just serial)

Any help pointing me in the right direction will be appreciated.
asked Sep 17, 2019 in Programmer Questions by lodani (240 points)

1 Answer

+2 votes
 
Best answer

yes, that can be done quite easily. You need to be setup for C++ programming, please see:

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

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

Then you need to add a member function

void process(jevois::RawImage const & input) override

{

 ...

}

to the DemoSaliency class in DemoSaliency.C

This function will be called by the JeVois core software when running in headless mode. To write the function, you take the other process() function and copy that code, then delete everything that involves the output image (outframe, outimg, etc).

Looking at the code at

http://jevois.org/basedoc/jvpkg_2modules_2JeVois_2DemoSaliency_2DemoSaliency_8C_source.html

it also looks like you would not need to run the saliency computation in a thread (which is parallelized with waiting for the out frame and drawing in it), you can just run

itsSaliency->process(inimg, true);

directly in the main thread of your process() function. I believe you then also should remove the call to 

itsSaliency->waitUntilDoneWithInput();

as this is intended for use when itsSaliency->process() is running in a thread.

Have a look at this tutorial for a general idea of the various steps:

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

answered Sep 23, 2019 by JeVois (46,580 points)
selected Sep 24, 2019 by lodani
Thank you very much for this extraordinarily detailed answer. I really appreciate it.
I have been beating my head into a wall on and off for yours now, this is very concise and I am looking forward to using it, thank you!
...