Implementing Barron “Performance of Optical Flow Techniques” 1994 C code

W.r.t. the C code horn.c, lucas.c from the J.L. Barron 1994 article “Performance of Optical Flow Techniques”

final psflow output
final psflow output

the original FTP site is no longer available.
There may be a partial mirror at University of Oviedo:
Prof. Barron has reposted the data to his website:

To compile the C code, we have to use appropriate compiler options. Try this in the HORN direcotry:
gcc -std=c89 -O3 -march=native horn.c -o horn -lm

You might need to add these includes:
#include <string.h>
#include <stdlib.h>

also change this line:

#define PI 3.14159265358979323846

You can find the necessary “rasterfile.h” under pub/vision/SOFTWARE to read the RAS files typically used. You can use Imagemagick or Irfanview to view the RAS files. You need to uncompress these .Z files first by typing:

gunzip -r TESTDATA/

Example run (first make output directory):
./horn newbinarytreet. 0.5 1.5 20 100 ../TESTDATA/TREE_DATA/TRANS ../output -B 150 150 -MH -T 5.0

To read this data you will need SOFTWARE/psflow which is compiled by:
edit psflow.c, adding the line:
#define M_PI 3.14159265358979323846
and compile with:

gcc -std=c89 -O3 -march=native psflow.c -o psflow -lm

then type:

./psflow ../output/horn.modified.newbinarytreet.F-5.00 ../output/

to get the image on this page.