source pkgsNeeded.tcl

ui_init "t_warp.tcl"
SetFileTypes

PH "Image warping with keypoints"

set srcimg [poImage NewImageFromFile "testIn/keksi$fInfo(suf)"]
$srcimg GetImageInfo w h a g
set dstimg [poImage NewImage $w $h $a $g]
set msg "Original image"
ui_addimg $srcimg $msg

set xsrc  [list 0.345 0.550]
set ysrc  [list 0.335 0.280]
set xdest [list 0.335 0.600]
set ydest [list 0.410 0.350]
set nkey  [llength $xsrc]

set fname "testOut/kptwarpLittleLocal$fInfo(suf)"
set msg   "$fname: Keyframe warping (2 keyframes) with little local effect"
P $msg
$dstimg WarpKeypoint $srcimg $nkey $xsrc $ysrc $xdest $ydest 2 0.1
$dstimg WriteSimple $fname $fInfo(fmt) $fInfo(vsn)
ui_addimg $dstimg $msg

set fname "testOut/kptwarpStrongLocal$fInfo(suf)"
set msg   "$fname: Keyframe warping (2 keyframes) with strong local effect"
P $msg
$dstimg WarpKeypoint $srcimg $nkey $xsrc $ysrc $xdest $ydest 2 1.0
$dstimg WriteSimple $fname $fInfo(fmt) $fInfo(vsn)
ui_addimg $dstimg $msg

set fname "testOut/kptwarpGlobal$fInfo(suf)"
set msg   "$fname: Keyframe warping (2 keyframes) with global effect"
P $msg
$dstimg WarpKeypoint $srcimg $nkey $xsrc $ysrc $xdest $ydest 2 0.0
$dstimg WriteSimple $fname $fInfo(fmt) $fInfo(vsn)
ui_addimg $dstimg $msg

set xsrc  [list 0.345 0.550 0.515]
set ysrc  [list 0.335 0.280 0.447]
set xdest [list 0.335 0.600 0.500]
set ydest [list 0.410 0.350 0.350]
set nkey  [llength $xsrc]

set fname "testOut/kptwarpKeyframe$fInfo(suf)"
set msg   "$fname: Keyframe warping (3 keyframes) with little local effect"
P $msg
$dstimg WarpKeypoint $srcimg $nkey $xsrc $ysrc $xdest $ydest 2 0.1
$dstimg WriteSimple $fname $fInfo(fmt) $fInfo(vsn)
ui_addimg $dstimg $msg

PS
P "End of test"

ui_show

if { [lindex $argv 0] eq "auto" } {
    ui_exit
    exit 0
}
