/[opencvs]/eyes/squarethem.pl
ViewVC logotype

Contents of /eyes/squarethem.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations)
Sat Oct 19 06:48:56 2013 UTC (4 years, 9 months ago) by hib
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +5 -1 lines
File MIME type: text/plain
cleaning up enlightenment.
But you know,  the eyes are not too good anymore, ever sinze I fixed the
pizza box effect. I bet that I can make custom squares that center the eye.
1 # read from analysis and then square out
2 #$val=300;
3 $val = $ARGV[0];
4 # val should be the destination size.
5 $from = $ARGV[1];
6 # from is 1 by default, but could be hoigher if we are just adding records
7 if (!defined($from)) {$from=="";}
8 if ($from eq "") { $from = 1;}
9 # 300 gives a 4800x4800 experience - which allows 600 dpi or 1200 dpi on regular paper - good for demo shots
10 # 375 gives a 6000x6000 experience
11 # 625 for our little strange dot gives us a 10000x10000 experience.
12 # 990 for 44 inches 15840 pixels 360 dpi
13 # 1980 for 44 inches 31680 720 dpi yeah!
14 # 1125 for 50 inches 18000 pixels 360 dpi
15 # we could run the match program, and try to make them match up
16 # but probably better with randomness.
17 # we would analyze twice then - once initially, and once again with the squares
18 $valxval = $val . "x" . $val;
19 $i = $from;
20 while (<STDIN>) {
21 ($fname,$width,$height,$r,$g,$b) = split(/\|/);
22 if ($width > $height) {
23 $nheight = $val;
24 $nwidth = int($val * $width / $height+0.99);
25 $d = "+" . int(($nwidth - $nheight)/2) . "+0";
26 }
27 else {
28 $nwidth = $val;
29 $nheight = int($val * $height / $width+0.99);
30 $d = "+0+" . int(($nheight - $nwidth)/2)
31 }
32
33
34 $name = $i . ".bmp";
35
36 print "convert \$ENLIGHTENMENT_HOME/common/pics/$fname -resize $nwidth" . "x" . "$nheight \$ENLIGHTENMENT_HOME/\$ENLIGHTENMENT_SIZE/m/f$name;";
37 print "convert \$ENLIGHTENMENT_HOME/\$ENLIGHTENMENT_SIZE/m/f$name -crop $val" . "x" . "$val$d \$ENLIGHTENMENT_HOME/\$ENLIGHTENMENT_SIZE/m/g$name;";
38 print "rm \$ENLIGHTENMENT_HOME/\$ENLIGHTENMENT_SIZE/m/[a-f]$name\n";
39 $i++;
40 }
41
42

  ViewVC Help
Powered by ViewVC 1.1.5