JeVoisBase  1.20
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Convert Class Reference

Simple module to convert between any supported camera grab formats and USB output formats. More...

Inheritance diagram for Convert:
Collaboration diagram for Convert:

Public Member Functions

virtual ~Convert ()
 Virtual destructor for safe inheritance. More...
 
virtual void process (jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override
 Processing function. More...
 
- Public Member Functions inherited from jevois::Module
 Module (std::string const &instance)
 
virtual ~Module ()
 
virtual void process (InputFrame &&inframe)
 
virtual void process (InputFrame &&inframe, GUIhelper &helper)
 
virtual void sendSerial (std::string const &str)
 
virtual void parseSerial (std::string const &str, std::shared_ptr< UserInterface > s)
 
virtual void supportedCommands (std::ostream &os)
 
- Public Member Functions inherited from jevois::Component
 Component (std::string const &instance)
 
virtual ~Component ()
 
std::shared_ptr< Comp > addSubComponent (std::string const &instance, Args &&...args)
 
void removeSubComponent (std::shared_ptr< Comp > &component)
 
void removeSubComponent (std::string const &instance, bool warnIfNotFound=true)
 
std::shared_ptr< Comp > getSubComponent (std::string const &instance) const
 
bool isTopLevel () const
 
Engineengine () const
 
bool initialized () const
 
const std::string & className () const
 
const std::string & instanceName () const
 
std::vector< std::string > setParamVal (std::string const &paramdescriptor, T const &val)
 
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 
std::vector< std::pair< std::string, T > > getParamVal (std::string const &paramdescriptor) const
 
getParamValUnique (std::string const &paramdescriptor) const
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 
std::vector< std::pair< std::string, std::string > > getParamString (std::string const &paramdescriptor) const
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 
void freezeParam (std::string const &paramdescriptor)
 
void unFreezeParam (std::string const &paramdescriptor)
 
void freezeAllParams ()
 
void unFreezeAllParams ()
 
std::string descriptor () const
 
void setParamsFromFile (std::string const &filename)
 
std::istream & setParamsFromStream (std::istream &is, std::string const &absfile)
 
virtual void paramInfo (std::shared_ptr< UserInterface > s, std::map< std::string, std::string > &categs, bool skipFrozen, std::string const &cname="", std::string const &pfx="")
 
void foreachParam (std::function< void(std::string const &compname, ParameterBase *p)> func, std::string const &cname="")
 
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category)
 
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category)
 
void setDynamicParameterCallback (std::string const &name, std::function< void(T const &)> cb, bool callnow=true)
 
void removeDynamicParameter (std::string const &name)
 
void setPath (std::string const &path)
 
std::filesystem::path absolutePath (std::filesystem::path const &path="")
 
std::shared_ptr< Comp > addSubComponent (std::string const &instance, Args &&...args)
 
void removeSubComponent (std::shared_ptr< Comp > &component)
 
void removeSubComponent (std::string const &instance, bool warnIfNotFound=true)
 
std::shared_ptr< Comp > getSubComponent (std::string const &instance) const
 
bool isTopLevel () const
 
Engineengine () const
 
bool initialized () const
 
const std::string & className () const
 
const std::string & instanceName () const
 
std::vector< std::string > setParamVal (std::string const &paramdescriptor, T const &val)
 
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 
std::vector< std::pair< std::string, T > > getParamVal (std::string const &paramdescriptor) const
 
getParamValUnique (std::string const &paramdescriptor) const
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 
std::vector< std::pair< std::string, std::string > > getParamString (std::string const &paramdescriptor) const
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 
void freezeParam (std::string const &paramdescriptor)
 
void unFreezeParam (std::string const &paramdescriptor)
 
void freezeAllParams ()
 
void unFreezeAllParams ()
 
std::string descriptor () const
 
void setParamsFromFile (std::string const &filename)
 
std::istream & setParamsFromStream (std::istream &is, std::string const &absfile)
 
virtual void paramInfo (std::shared_ptr< UserInterface > s, std::map< std::string, std::string > &categs, bool skipFrozen, std::string const &cname="", std::string const &pfx="")
 
void foreachParam (std::function< void(std::string const &compname, ParameterBase *p)> func, std::string const &cname="")
 
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category)
 
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category)
 
void setDynamicParameterCallback (std::string const &name, std::function< void(T const &)> cb, bool callnow=true)
 
void removeDynamicParameter (std::string const &name)
 
void setPath (std::string const &path)
 
std::filesystem::path absolutePath (std::filesystem::path const &path="")
 
- Public Member Functions inherited from jevois::ParameterRegistry
virtual ~ParameterRegistry ()
 

Related Functions

(Note that these are not member functions.)

 JEVOIS_DECLARE_PARAMETER (quality, int, "Compression quality for MJPEG", 75, jevois::Range< int >(1, 100), ParamCateg)
 Parameter. More...
 

Additional Inherited Members

- Protected Member Functions inherited from jevois::Component
virtual void preInit ()
 
virtual void postInit ()
 
virtual void preUninit ()
 
virtual void postUninit ()
 
virtual void preInit ()
 
virtual void postInit ()
 
virtual void preUninit ()
 
virtual void postUninit ()
 
- Protected Member Functions inherited from jevois::ParameterRegistry
void addParameter (ParameterBase *const param)
 
void removeParameter (ParameterBase *const param)
 
void callbackInitCall ()
 

Detailed Description

Simple module to convert between any supported camera grab formats and USB output formats.

This module can convert from any supported camera sensor pixel format (YUYV, BAYER, RGB565) to any supported USB output pixel format (YUYV, GREY, MJPG, BAYER, RGB565, BGR24).

See Advanced topic: Image pixel formats for information about supported pixel formats.

This module accepts any resolution supported by the JeVois camera sensor:

  • SXGA (1280 x 1024): up to 15 fps
  • VGA (640 x 480): up to 30 fps
  • CIF (352 x 288): up to 60 fps
  • QVGA (320 x 240): up to 60 fps
  • QCIF (176 x 144): up to 120 fps
  • QQVGA (160 x 120): up to 60 fps
  • QQCIF (88 x 72): up to 120 fps

This module also automatically rescales the image if input and output sizes differ.

Things to try

Edit JEVOIS:/config/videomappings.cfg on your MicroSD card (see Advanced topic: Video mappings and configuring machine vision modes) and try to add some new convert mappings. Not all of the thousands of possible convert mappings have been included in the card to avoid having too many of these simple conversion mappings in the base software distribution. For example,

YUYV 176 144 115.0 BAYER 176 144 115.0 JeVois Convert

will grab raw BAYER frames on the sensor, with resolution 176x144 at 115 frames/s, and will convert them to YUYV before sending them over the USB link. To test this mapping, select the corresponding resolution and framerate in your video viewing software (here, YUYV 176x144 @ 115fps). Although the sensor can capture at up to 120fps at this resolution, here we used 115fps to avoid a conflict with a mapping using YUYV 176x144 @ 120fps USB output and the SaveVideo module that is already in the default videomappings.cfg file.

Note that this module may suffer from DMA coherency artifacts if the camturbo parameter of the jevois::Engine is turned on, which it is by default. The camturbo parameter relaxes some of the cache coherency constraints on the video buffers captured by the camera sensor, which allows the JeVois processor to access video pixel data from memory faster. But with modules that do not do much processing, sometimes this yields video artifacts, we presume because some of the video data from previous frames still is in the CPU cache and hence is not again fetched from main memory by the CPU. If you see short stripes of what appears to be wrong pixel colors in the video, try to disable camturbo by editing JEVOIS:/config/params.cfg on your MicroSD card and in there turning camturbo to false.

Author
Laurent Itti
Videomapping:
BAYER 640 480 26.8 YUYV 640 480 26.8 JeVois Convert
Videomapping:
BGR24 640 480 26.8 YUYV 640 480 26.8 JeVois Convert
Videomapping:
GREY 640 480 26.8 YUYV 640 480 26.8 JeVois Convert
Videomapping:
RGB565 640 480 26.8 YUYV 640 480 26.8 JeVois Convert
Videomapping:
MJPG 352 288 60.0 BAYER 352 288 60.0 JeVois Convert
Videomapping:
MJPG 320 240 30.0 RGB565 320 240 30.0 JeVois Convert
Videomapping:
MJPG 320 240 15.0 YUYV 320 240 15.0 JeVois Convert
Videomapping:
YUYV 640 480 20.0 YUYV 640 480 20.0 JeVois Convert
Email:
itti@usc.edu
Address:
University of Southern California, HNB-07A, 3641 Watt Way, Los Angeles, CA 90089-2520, USA
Main URL:
http://jevois.org
Support URL:
http://jevois.org/doc
Other URL:
http://iLab.usc.edu
License:
GPL v3
Distribution:
Unrestricted
Restrictions:
None

Definition at line 100 of file Convert.C.

Constructor & Destructor Documentation

◆ ~Convert()

virtual Convert::~Convert ( )
inlinevirtual

Virtual destructor for safe inheritance.

Definition at line 107 of file Convert.C.

Member Function Documentation

◆ process()

virtual void Convert::process ( jevois::InputFrame &&  inframe,
jevois::OutputFrame &&  outframe 
)
inlineoverridevirtual

Processing function.

Reimplemented from jevois::Module.

Definition at line 110 of file Convert.C.

Friends And Related Function Documentation

◆ JEVOIS_DECLARE_PARAMETER()

JEVOIS_DECLARE_PARAMETER ( quality  ,
int  ,
"Compression quality for MJPEG"  ,
75  ,
jevois::Range< int >  1, 100,
ParamCateg   
)
related

Parameter.


The documentation for this class was generated from the following file: