#optical-flow #robotics #camera #imaging #computer-vision

no-std correlation_flow

Optical flow measurement with image phase correlation

1 unstable release

0.1.4 Oct 1, 2020
0.1.2 Sep 4, 2020
0.1.1 Sep 2, 2020
0.1.0 Sep 1, 2020

#4 in #optical-flow

Download history 16/week @ 2024-02-26 11/week @ 2024-03-11 80/week @ 2024-04-01

91 downloads per month

BSD-3-Clause

26KB
135 lines

correlation_flow

Optical flow calculation using image correlation for no_std rust. This library will compare small grayscale image blocks (limited to 64x64 pixels currently), and detect the phase correlation between them. This potentially enables applications such as:

  • Create image panoramas by seaming together overlapping images
  • Detect optical flow translation (for machine vision / robotics)
  • Image registration
  • Measure image similarity

Embedded Examples

The examples are designed to be used with J-Link / RTT. We provide a couple different ways to run these:

With probe-run installed

  • Simply run the example (see below) with a JLink debug probe attached to your PX4FLOW
  • If you have problems, edit config to ensure that the probe-run runner is selected

With segger tools installed

  • Edit config to select the segger.gdb runner
  • In one shell run: ./start_gdb_server_jlink.sh
  • In another shell run: JLinkRTTClient
  • Then run your choice of examples

PX4FLOW

This example is intended to run on the PX4FLOW hardware. It simply compares two image frames stored in the app binary.

cargo run --release --example px4flow 

Image Conversion

We used ImageMagick's convert command to generate raw 8-bit grayscale images from png files using eg:

convert 64sq_253_46.png -depth 8 64sq_253_46.gray

Status

  • Detects discrete 2D image translation within a static 64x64 grid (maximum +/- 32 pixel movement)
  • Example that runs on embedded hardware (PX4FLOW)
  • Support > 64x64 block sizes

Dependencies

~1MB
~25K SLoC