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

Contents of /eyes/build_jos_eye_source.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Sat Aug 17 21:34:31 2013 UTC (4 years, 8 months ago) by hib
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +4 -1 lines
File MIME type: text/plain
random doesnt work well. did other way
1 # lines
2 # read 3 files in the txt format
3 # 1. chroma frequency estimate
4 # 2. Distance of points
5 # 3. intensity of points
6
7 srand(1283192);
8
9
10
11 open(F1,"chroma3_freq.txt");
12 open(F2,"distance4.txt");
13 open(F3,"intensity2.txt");
14 while (<F1>) {
15 $s=$_;
16 ($x,$y,$wl,$r,$g,$b) = split(/\|/,$s);
17 $d=<F2>;
18 ($x2,$y2,$r2,$g2,$b2) = split(/\|/,$d);
19 $j=<F3>;
20 ($x3,$y3,$r3,$g3,$b3) = split(/\|/,$j);
21 if (($x != $x2)||($y != $y2)) {
22 print STDERR "Errror mismatch:\n\n$s\n$d\n";
23 exit(-1);
24 }
25 if (($x != $x3)||($y != $y3)) {
26 print STDERR "Errror mismatch:\n\n$s\n$j\n";
27 exit(-1);
28 }
29 $avg = ($r2+$g2+$b2)/3.;
30 $avgi = ($r3+$g3+$b3)/3.+1;
31 $d = (1.5 + 8.0 * ((256.-$avg) / 255.))/12.*3.;
32 # $d = $d + rand(70)/2600; # slight variance in height
33 # $phase = rand(3.1415927*2.0);
34 $phase = 0;
35 # $x = ($x +rand(70)/100-0.35)* 3.5;
36 # $y = ($y +rand(70)/100-0.35)*3.5;
37 $x *= 3.5;
38 $y *= 3.5;
39 $z = $d / 3.2808399; # convert from feet to meters
40 print "$x|$y|$z|$avgi|$wl" . "e-9|$phase\n";
41 }
42

  ViewVC Help
Powered by ViewVC 1.1.5