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.

using one module inside another

0 votes
Is it possible to use one ready-made module inside another? I'm asking this because it would make it very convenient to combine multiple modules. For example, saving the output of a module would become a breeze if I could just write

itsVideoSaver.start()

itsVideoSaver.stop()

instead of writing all that code again and making sure I didn't miss anything that would break my code. I am actually asking this question specifically because I want to save the video output of a module, but I feel the question could be generalized.
asked Nov 23, 2019 in Programmer Questions by sidharth (250 points)

1 Answer

0 votes
 
Best answer
Definitely, yes this is very nice to have. JeVois supports this, just the vocabulary is a bit different:

- you can create Component objects that may host a number of Parameters and any number of sub-components.

- Module derives from Component but is intended to be a terminal entity.

- in JeVois, you load and run one module at a time. The root of the hierarchy is the Engine, which holds the module as a sub-component, which in turn can hold more sub-components.

For more info, see

http://jevois.org/doc/classjevois_1_1Component.html

A good example is the ArUcoBlob module which has an ArUco subcomponent plus several BlobDetector sub-components. For more examples search for "addSubComponent" in the source tree of jevoisbase.

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

This one may also be a good starting point for you:

http://jevois.org/basedoc/classBufferedVideoReader.html
answered Nov 26, 2019 by JeVois (46,200 points)
selected Nov 27, 2019 by sidharth
thanks! I will look into this. For now, I am storing images frame by frame for dataset generation. As the datasets are small (10-20fps for 2 minutes max.), the frame by frame method will work, however, the video writing method would be preferable for longer videos in the future.
...