JeVoisBase  1.5
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
RoadNavigation Class Reference

Road finder demo. More...

Inheritance diagram for RoadNavigation:
Collaboration diagram for RoadNavigation:

Public Member Functions

 RoadNavigation (std::string const &instance)
 Constructor. More...
 
virtual ~RoadNavigation ()
 Virtual destructor for safe inheritance. More...
 
virtual void process (jevois::InputFrame &&inframe) override
 Processing function, no video out. More...
 
virtual void process (jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override
 Processing function with USB video out. More...
 
- Public Member Functions inherited from jevois::StdModule
 StdModule (std::string const &instance)
 
virtual ~StdModule ()
 
void sendSerialImg1Dx (unsigned int camw, float x, float size=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialStd1Dx (float x, float size=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialImg1Dy (unsigned int camh, float y, float size=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialStd1Dy (float y, float size=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialImg2D (unsigned int camw, unsigned int camh, float x, float y, float w=0.0F, float h=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialStd2D (float x, float y, float w=0.0F, float h=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialContour2D (unsigned int camw, unsigned int camh, std::vector< cv::Point_< T > > points, std::string const &id="", std::string const &extra="")
 
void sendSerialStd3D (float x, float y, float z, float w=0.0F, float h=0.0F, float d=0.0F, float q1=0.0F, float q2=0.0F, float q3=0.0f, float q4=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialStd3D (std::vector< cv::Point3f > points, std::string const &id="", std::string const &extra="")
 
- Public Member Functions inherited from jevois::Module
 Module (std::string const &instance)
 
virtual ~Module ()
 
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)
 
 JEVOIS_DEFINE_ENUM_CLASS (SerStyle,(Terse)(Normal)(Detail)(Fine)) JEVOIS_DECLARE_PARAMETER(serstyle
 
 JEVOIS_DECLARE_PARAMETER (serprec, unsigned int, "Number of decimal points in standardized serial messages as " "defined in http://jevois.org/doc/UserSerialStyle.html", 0U, ParamCateg)
 
- Public Member Functions inherited from jevois::Component
 Component (std::string const &instance)
 
virtual ~Component ()
 
std::shared_ptr< ComponentgetSubComponent (std::string const &instance) const
 
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
 
bool initialized () const
 
std::string const & className () const
 
std::string const & 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)
 
void setPath (std::string const &path)
 
std::string absolutePath (std::string 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
 
bool initialized () const
 
std::string const & className () const
 
std::string const & 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)
 
void setPath (std::string const &path)
 
std::string absolutePath (std::string const &path="")
 
- Public Member Functions inherited from jevois::ParameterRegistry
virtual ~ParameterRegistry ()
 

Protected Attributes

jevois::Timer itsProcessingTimer
 Module internals. More...
 
std::shared_ptr< RoadFinderitsRoadFinder
 

Related Functions

(Note that these are not member functions.)

 JEVOIS_DECLARE_PARAMETER (vpconf, float, "Minimum vanishing point confidence required to send a serial message", 0.0F, roadfinder::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

Road finder demo.

This algorithm detects road using a compination of edge detection and tracking, and texture analysis. The algorithm is an implementation of Chang, Siagian and Itti, IROS 2012, available at http://ilab.usc.edu/publications/doc/Chang_etal12iros.pdf

The algorithms combines detection and tracking of line segments at the edges of the road or on the road (e.g., lane dividers), and texture analysis to distinguish the road region from its surroundings.

The algorithm outputs the horizontal coordinate of the vanishing point of the road, which usually is a good indication of the road heading (except in very tight bends or corners).

Demo display outputs

Detected line segments are shown in black and white, while segments that have been reliably tracked over multiple frames are shown in thick purple. Estimated vanishing point location and confidence is shown as a big green disk on the horizon line.

Note that the demo display runs much slower than the algorithm with no video output (which should be used on autonomous cars), simply because drawing all the detected line segments takes a lot of time.

Serial Messages

This module can send standardized serial messages as described in Standardized serial messages formatting. One 1D message is issued on every video frame for the vanishing point's horizontal location.

  • Serial message type: 1D
  • id: always vp (shorthand for vanishing point)
  • x: standardized 2D horizontal coordinate of the vanishing point
  • w: always 0
  • extra: none (empty string)

Trying it out

To casually try out this module, just search the web for pictures of roads and point the JeVois camera to one of them. Make sure that you align the horizon line of the algorithm (which has a number of purple and green disks) roughly with the horizon line in your picture. As you move the camera left and right, the location of the large green disk that marks the detected vanishing point should move left and right, and should point to the vanishing point of the road in your image.

When using on a mobile robot in the real world, setting the proper horizon line is essential for good operation of the algorithm. This is determined by parameter horizon, which should be tuned according to the height and tilt angle of the JeVois camera on your vehicle.

Author
Laurent Itti
Videomapping:
NONE 0 0 0 YUYV 320 240 30.0 JeVois RoadNavigation
Videomapping:
NONE 0 0 0 YUYV 176 144 120.0 JeVois RoadNavigation
Videomapping:
YUYV 320 256 30.0 YUYV 320 240 30.0 JeVois RoadNavigation
Videomapping:
YUYV 176 160 120.0 YUYV 176 144 120.0 JeVois RoadNavigation
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 RoadNavigation.C.

Constructor & Destructor Documentation

◆ RoadNavigation()

RoadNavigation::RoadNavigation ( std::string const &  instance)
inline

Constructor.

Definition at line 106 of file RoadNavigation.C.

References itsRoadFinder.

◆ ~RoadNavigation()

virtual RoadNavigation::~RoadNavigation ( )
inlinevirtual

Virtual destructor for safe inheritance.

Definition at line 115 of file RoadNavigation.C.

Member Function Documentation

◆ process() [1/2]

virtual void RoadNavigation::process ( jevois::InputFrame &&  inframe)
inlineoverridevirtual

Processing function, no video out.

Reimplemented from jevois::Module.

Definition at line 120 of file RoadNavigation.C.

References itsRoadFinder, and jevois::StdModule::sendSerialImg1Dx().

◆ process() [2/2]

Friends And Related Function Documentation

◆ JEVOIS_DECLARE_PARAMETER()

JEVOIS_DECLARE_PARAMETER ( vpconf  ,
float  ,
"Minimum vanishing point confidence required to send a serial message"  ,
0.  0F,
roadfinder::ParamCateg   
)
related

Parameter.

Member Data Documentation

◆ itsProcessingTimer

jevois::Timer RoadNavigation::itsProcessingTimer
protected

Module internals.

Definition at line 194 of file RoadNavigation.C.

Referenced by process().

◆ itsRoadFinder

std::shared_ptr<RoadFinder> RoadNavigation::itsRoadFinder
protected

Definition at line 195 of file RoadNavigation.C.

Referenced by process(), and RoadNavigation().


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