Unix: setenv CLASSPATH ./ovis.jar:gr.jar:gnu.jar:/home/zilla/zilla/Devl/Java/L/Jars/zlib.jar:zs.jar:cin.jar:GRserver.jar Win: set _CLASSPATH=c:\x\FlowUtil.jar;c:\x\ovis.jar;... java -classpath %_CLASSPATH% ...
FlowL computes flow FlowN computes flow, older version FlowSloMo computes inbetween frames using flow FlowMoBlur fake 2d motion blur using flow FlowPaint warps an overlay painting according to the flow FlowCompose composes 2 flow files FlowZoom upres a flow file FlowHacks convert flow into visible ppm file FlowUtil convert flo file into Burkitt benchmark format flowchase.py script to compute frame-to-next-frame flow over a shot flowchasenodrift.py script to compute first-frame-to-every-other-frame flow
To do slow motion, run flowchase, then run FlowSloMo.
To do fake motion blur, run flowchase, then run FlowMoBlur.
To warp an overlay to carry it along with part of the scene, paint the overlay (it uses the overlay luminance as the matte), run flowchasenodrift (not flowchase), then run FlowPaint.
IMPORTANT, the vectors point from target back to source, and the warp is source warped toward target. If you want vectors that point from source to target, run in the opposite order:
java FlowN targetimage sourceimage ...
-backwards runs the flow from the last frame back towards the first.
* Using standard backwards warp, think of target as pulling the source * towards it. The result is put in warptmp, and then the warp * from target back to warptmp is computed. This delta warp is added * to the warp, source is again pulled toward target and put into warptmp, * iterate. Addtion of vectors is commutative so this should work. * * To compute the forward flow from source to target just reverse * the order: source pulls target back to it, this gives the forward flow. * When computing slowmo by flow the results are visibly MUCH better * when the flow is computed as java FlowL target source [-flipflow] * rather than in the source->target order.
flow.####.ppm contain the original frame warped to match frame n.
Look at the files _tmp_ff* while it is running, these give
an indication of how it is doing.
_tmp_fflow_1_0046_0047.ppm contains frame 46 warped forward 1 frame to match
47, so view 46, this temp file, and 47. After computing every frame
to the next, it moves to intervals of 2 frames, 4 frames, etc:
_tmp_fflow_8_0038_0046.ppm contains frame 38 warped forward 8 frames to match
frame 46.
-flowgo Flowgo_z5 -flowgo Flowgo_z7 _z7 tries to handle flow discontinuities and is more accurate, but Slow. Use it for frame-to-frame computing. For -fnodrift try _z5 first. -niter 3 number of iterations. change to 2 or 1 for quick tests. has diminishing returns, but in ground-truth test it was still improving between 5 and 20 iterations! -pyrscale 0.75 scaling between pyramid levels -criticalpoint true|false set to true for images where there are lots of traveling shadows. causes it to focus more on corner-like features. -flow_z4_lambda 1.5 controls smoothness. Make this higher if the resulting warp is too wiggly, or if doing nodrift, make smaller if the flow does not capture details. -flow_z4_nmembrane 250 number of relaxation iterations per global iteration, set to 100 for quick tests -flow_z7_disvel 0.05 velocity discontinuity threshold - try not to smooth over a region where neighboring velocities are more than this.Running it without a script
Typical usage should be likejava -mx200m FlowL source.ppm target.ppm warp.ppm flowwhere source,target are typically frames 1,2 or 2,3 or 3,4...; warp is the resulting picture: source morphed to match target, and flow is the binary flowfield.Files
_tmp* temporary files *.flo file containing both x,y components of flow flow__u.flt, old format x component of flow field flow_ _v.flt old format y component *.flow flow in Burkitt format( for ground truth), flow vector uses this, otherwise not needed. FlowPaint
FlowPaint warps a single frame according to the flow.
Usage:java FlowPaintThis expects files flow100_u.flt, etc. in the current directory and writes art.* (the warped artwork frame) and comp.* (the artwork comp'd over the plates) also in the current directory.java FlowPaint ~me/xx.100-105.png flow Pics/xx.0100_Flowpaintart.ppm FlowSloMo
Generates in-between frames using flow.java FlowSloMo /x/y/elephant.1-20.png flow 3First argument is the sequence of plates, second is prefix for the flow files (must be in current directory), so the command above reads flow.0001.flo, flow.0002.... Third argument is the number of output frames per input frame, so 3 = 1/3 speed with 2 new frames per old frame.
The output is comp.####.ppm.FlowMoBlur
java FlowMoBlur /x/y/elephant.1-20.png flow 1.5Does 2d linear motion blur using the flow -- the current frame is blurred along the reverse of the flow vector at each pixel. The third argument scales the flow vectors, bigger = more motion blur.
The output is comp.####.ppm.
Beware of bug: something may be backwards here. I got a much better looking result by running it on frames 2->1 than by on frames 1->2.FlowHacks
Temporary usage:java FlowHacks file.flo prefixConverts the .flo file into visible prefix_u.ppm and prefix_v.ppm.Image formats
ppm, png, jpg, sgi 8bit verbatim. Sometimes cineon, bmp.Barron flow stuff
The test sequences are in sun raster format, convert to ppm with the linux 'convert' program.Java FlowUtil in.flo out.flow
Converts new .flo format into Burkitt format, including flipping vector direction.calc_error (C program)
If the reported error is e.g. 100percent the first thing to check is flipping the flow direction. Can do this in FlowUtil.calc_error -A -B 0 25 5 ../_tmpqflow.flow -F G/yos_newcorrect.9.Gflowpsflow (C program)
-sN subsamples by N.
-mS scales magnitude of vectors by S.psflow -s5 -m2 ../_tmpqflow.flow flowplot.ps