📄 headsearch.pl
字号:
#!/usr/local/bin/perl# This function takes FERET's eye coordinate file which is in format# "filename col1 row1 col2 row2"# and converts it to a headsearch ms_eigsearch.out format which is # "filename scale 1 row col 1.0die "\nUsage:\t headsearch.pl file1 file2\n" if $#ARGV != 1;open(F, $ARGV[0]) || die "$ARGV[0] not openable\n";open(G, ">$ARGV[1]") || die "$ARGV[1] not openable\n";while ($f=<F>){ @foo = split(/\b /,$f); $foo[1]=$foo[1]+1; $foo[2]=$foo[2]+1; $foo[3]=$foo[3]+1; $foo[4]=$foo[4]+1; $x1=int($foo[2]/2.0 + 0.5); $x2=int($foo[4]/2.0 + 0.5); $y1=int($foo[1]/2.0 + 0.5); $y2=int($foo[3]/2.0 + 0.5); $mx=int(($x1+$x2)/2.0 + 0.5); $my=int(($y1+$y2)/2.0 + 0.5); $dx=($x2-$x1); $dy=($y2-$y1); $dist=sqrt($dx*$dx + $dy*$dy); $scale=6.0/$dist; printf G ("$foo[0] \t $scale \t 1 $mx $my \t 1.0\n")}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -