JeVoisBase
1.20
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
Share this page: |
|
|
|
|
|
|
Go to the documentation of this file.
30 cv::Size(2, 2), ParamCateg);
56 public jevois::Parameter<grid>
62 using StdModule::StdModule;
80 pipe->
process(inimg,
this, outimg, helper, idle);
107 std::string
const & fpscpu = timer.stop();
111 unsigned short winw, winh;
116 cv::Size
const g = grid::get();
117 if (g.width == 0 || g.height == 0)
LFATAL(
"Cannot handle zero rows or columns of models");
118 unsigned int totw = img.
width * g.width, toth = img.
height * g.height;
120 int const xoff = (winw - totw) / 2;
121 int const yoff = (winh - toth) / 2;
122 unsigned short iw = totw / g.width;
123 unsigned short ih = toth / g.height;
126 int x = xoff, y = yoff;
int n = 0;
134 doprocess(pipe, inframe,
nullptr, &helper, idle);
137 ++n; x += iw;
if (x >
int(totw) - iw/2) { x = xoff; y += ih; }
141 helper.
iinfo(inframe, fpscpu, winw, winh);
150 void onParamChange(grid
const & JEVOIS_UNUSED_PARAM(param), cv::Size
const & newval)
override
153 size_t const num = newval.width * newval.height;
154 if (num == 0)
LFATAL(
"Cannot handle zero rows or columns of models");
162 std::vector<std::shared_ptr<jevois::dnn::Pipeline>>
itsPipes;
void onParamChange(grid const &JEVOIS_UNUSED_PARAM(param), cv::Size const &newval) override
Processing function, no video output.
bool startFrame(unsigned short &w, unsigned short &h)
void removeSubComponent(std::shared_ptr< Comp > &component)
std::vector< std::shared_ptr< jevois::dnn::Pipeline > > itsPipes
JEVOIS_REGISTER_MODULE(MultiDNN)
Run multiple neural networks in parallel with a tiled display.
virtual ~MultiDNN()
Virtual destructor for safe inheritance.
void applyLetterBox(unsigned int &imw, unsigned int &imh, unsigned int const winw, unsigned int const winh, bool noalias)
void drawInputFrame(char const *name, InputFrame const &frame, int &x, int &y, unsigned short &w, unsigned short &h, bool noalias=false, bool casync=false)
void iinfo(jevois::InputFrame const &inframe, std::string const &fpscpu, unsigned short winw=0, unsigned short winh=0)
std::string to_string(T const &val)
void process(jevois::RawImage const &inimg, jevois::StdModule *mod, jevois::RawImage *outimg, jevois::OptGUIhelper *helper, bool idle=false)
void doprocess(std::shared_ptr< jevois::dnn::Pipeline > pipe, jevois::InputFrame const &inframe, jevois::RawImage *outimg, jevois::OptGUIhelper *helper, bool idle)
Processing function implementation.
JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(dataroot, std::string, "Root path for data, config, and weight files. " "If empty, use the module's path.", JEVOIS_SHARE_PATH "/darknet/single", ParamCateg)
Parameter.
virtual void process(InputFrame &&inframe, OutputFrame &&outframe)