NVIDIA VPI GStreamer Plug-in - Examples - Harris Keypoints Detector

From RidgeRun Developer Wiki



Previous: Examples/Undistort Index Next: Examples/KLT Tracker





Introduction

The vpiharrisdetector element applies the Harris Corner Detector algorithm from the NVIDIA VPI library to a video stream.

Element properties

  • backend

Backend to use to execute VPI algorithms. Available options:

cpu: CPU backend
cuda: CUDA backend
pva: PVA backend (Xavier only)
vic: VIC backend

Flags: readable, writable
Default: "cuda"

  • gradient-size

Block window size used to compute the Harris Corner score. Available options:

3: Gradient size of 3
5: Gradient size of 5
7: Gradient size of 7

Flags: readable, writable
Default: 5

  • block-size

Block window size used to compute the Harris Corner score. Available options:

3: Window size of 3
5: Window size of 5
7: Window size of 7

Flags: readable, writable
Default: 5

  • nms-distance

Non-maximum suppression radius, set to 0 to disable it. For PVA backend, this must be set to 8.
Type: Double
Range: 0 - 1,797693e+308
Flags: readable, writable
Default: 8

  • sensitivity

Specifies sensitivity threshold from the Harris-Stephens equation.
Type: Double
Range: 0 - 1
Flags: readable, writable
Default: 0.01

  • strength-thresh

Specifies the minimum threshold with which to eliminate Harris Corner scores.
Type: Double
Range: 0 - 1,797693e+308
Flags: readable, writable
Default: 20

Example

The following example pipe will help you detect and draw key points and corners in your input video stream. You may modify the properties values according to the information above.

  • Unified memory
gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! 'video/x-raw,format=GRAY8' ! vpiupload ! vpiharrisdetector gradient-size=3 block-size=3 nms-distance=8 sensitivity=0.01 strength-thresh=20 ! vpioverlay ! vpidownload ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nvoverlaysink
  • NVMM memory
gst-launch-1.0 nvarguscamerasrc ! nvvidconv bl-output=false ! 'video/x-raw(memory:NVMM),format=GRAY8' ! vpiupload ! vpiharrisdetector gradient-size=3 block-size=3 nms-distance=8 sensitivity=0.01 strength-thresh=20 ! vpioverlay ! vpidownload ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nvoverlaysink

Alternative display pipeline.

gst-launch-1.0 nvarguscamerasrc ! nvvidconv bl-output=false ! 'video/x-raw(memory:NVMM),format=GRAY8' ! vpiupload ! vpiharrisdetector gradient-size=3 block-size=3 nms-distance=8 sensitivity=0.01 strength-thresh=20 ! vpioverlay ! vpidownload ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nvvidconv ! autovideosink


Previous: Examples/Undistort Index Next: Examples/KLT Tracker