H-Lines

Purpose: detect visual landmarks and avoid obstacles.

H-Lines uses optical flow to detect and locate prominent line segments that are horizontal in 3D space. Its advantages are

  1. It's fast. Most optical-flow techniques are very cpu intensive and so tend to be slow.
  2. It complements sonar well because it's best suited to detecting obstacles that are difficult for sonar to locate.

 

API

To compute 3D distances, two frames are needed. Between each frame, the robot (or just the camera) must move forward a short, known distance -- about 150 mm. Travel should be in a straight line, without rotation. To start a new H-Line series, call locateHLines(), passing it a travel distance of 0.

For each subsequent frame, move the robot or camera, then call locateHLines() again, passing it the distance traveled. After each call, the HLineMetadata_t struct indicates how many 3D line segments were located. To retrieve data for the 3D line segments, use nextLine().

Functions:

Data Types:

The camera should be tilted down about 30 degrees when using H-Lines, but it should not otherwise be twisted. The tilt angle must be specified with good precision.

 

Code Example

 

Executing Through MavisCtl

 

Ini-File Parameters

The H-Lines functionality uses eight parameters:

robot#width

hlines#gyThreshold
hlines#minLineLen
hlines#maxLeastSquaresError
hlines#maxEndPtShift
hlines#maxSlopeChange
hlines#maxPctError
hlines#gausHalfWidth

Fortunately, all but one (robot#width), are easily defaulted. See mavis.ini for descriptions of these parameters.

The camera-placement and calibration parameters must also be set:
camera#height
camera#fwdPosition
camera#f
camera#tiltAngle

See Configuring Mavis and Camera Calibration for more on these parameters.

 

How It Works

 

Source Code

  • mavis/multiView/hlines.h
  • mavis/multiView/hlines.cpp

 

Home | Mavis | Mavis Capabilities