Localization

Function

The module provides current camera pose w.r.t a pre-built 3D model of the environment. In detail, every received image is passed to SURF detector & descriptor, the descriptors are matched to the model and verified by P3P in a RANSAC loop.

Inputs

Required:
  • rst::vision::Image: Image stream on RSB
  • 3D point cloud: 3d.surf
  • Internal camera calibration: K.txt

Optional:
see below (Command-Line Parameters)

Outputs

  • rst::geometry::Pose: Camera pose on RSB. The resulting message contains the pose of the camera in position + orientation (unit quaternion) format. The returned quaternion is zero if localization was not successful. Creation time of the pose message is set to the creation time of the image message.

Interface

Component
    {Localization}
    {The module provides camera pose w.r.t a pre-built 3D model of the environment given an image from the image stream.}
    Informers
        * {poses} {/nao/camerapose/0} {rst::geometry::Pose}
    Listeners
        * {images} {/nao/vision/0} {rst::vision::Image}

Restrictions

Functional:
  • The quality of pose estimation is better, when the camera is not moving when capturing the scene.
Technical:
  • 64bit architecture is recommended for fast computation of SURF descriptors.
  • required 3rd party libraries: Speeded-Up Robust Features (SURF), FLANN
  • TODO: creation of 3D model

Usage

Command-line Parameters

rsblocalization -m 3d.surf -k K.txt [options]
  • -m 3d.surf
    • pre-built 3D model of the environment (output of the mapping script)
  • -k K.txt
    • 3x3 calibration matrix of the camera
  • -r rd.txt
    • radial distortion parameters of the camera (optional)
  • -i /nao/vision/0
    • input image RSB scope (rst::ImageMessage)
  • -o /nao/camerapose/0
    • output pose RSB scope (rst::PoseMessage)
  • -d 40
    • blob response threshold of SURF detector
  • -f 256
    • FLANN checks during ANN matching
  • -n 0.75
    • second closest NN ratio for matching
  • -p 10
    • minimum number of points used
  • -e 0.5
    • maximum epipolar error for P3P in pixels
  • -c 0.9999
    • RANSAC loop confidence (stopping criterion)
  • -s 1000
    • maximum number of RANSAC samples
  • -q
    • quiet mode (no console output)