source: research/2008-displacement/README @ 2288

Last change on this file since 2288 was 2288, checked in by Sam Hocevar, 14 years ago
  • Add mode 8, for the very first graphic in the paper.
  • Add results for mode 8 in part0/lena-values.txt.
  • Make the bytecode version use less memory.
File size: 11.7 KB
Line 
1# List all my 4chan images
2find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].???' | rev | sort -k2 -t. | rev > 4chan-list.txt
3
4# Put all my 4chan images in 100 separate /tmp directories
5for x in $(seq -w 00 09); do echo $x; mkdir -p /tmp/4chan/$x; cp $(find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'$x'.???') /tmp/4chan/$x; done
6
7# Condorcet voting for phase 2 results
8#  - raster + E
9#  - raster + E_min
10#  - serpentine + E
11#  - serpentine + E_min
12for x in part2/*txt ; do grep '^.1' $x | awk '{ print $3,$5 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
13for x in part2/*txt ; do grep '^.1' $x | awk '{ print $3,$9 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
14for x in part2/*txt ; do grep '^.2' $x | awk '{ print $3,$5 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
15for x in part2/*txt ; do grep '^.2' $x | awk '{ print $3,$9 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
16
17# Get phase 3 and phase 4 stuff
18# .. from canard
19ssh canard.zoy.org "cd test-20080329; tar cz *raster.txt" | tar xz
20ssh canard.zoy.org "cd test-20080329; tar cz *serp.txt" | tar xz
21for x in *-raster.txt; do y="$x"; y="${y%%-raster.txt}"; y="${y%%.tiff}"; y="${y##usc-sipi}"; \mv "$x" part3/"$y".txt; done
22for x in *-serp.txt; do y="$x"; y="${y%%-serp.txt}"; y="${y%%.tiff}"; y="${y##usc-sipi}"; \mv "$x" part4/"$y".txt; done
23# .. from poulet (cpushare)
24scp poulet.zoy.org:cpushare/'test*-*.txt' .
25for f in test6-*.txt; do grep '###' $f|cut -f2 -d'`'|cut -f1 -d"'"|tr / .|while read i ; do sed -ne '/`'$i'/,/limit/p' $f | cut -b61- >| part3/$(echo $i | cut -f5 -d.).txt ; done; done; rm -f test6-*.txt
26for f in test7-*.txt; do grep '###' $f|cut -f2 -d'`'|cut -f1 -d"'"|tr / .|while read i ; do sed -ne '/`'$i'/,/limit/p' $f | cut -b61- >| part4/$(echo $i | cut -f5 -d.).txt ; done; done; rm -f test7-*.txt
27
28# Condorcet voting for part 3 and 4
29for x in part3/*txt ; do cat $x | awk '{ print $2,$4 }' >| $x.clean; done ; ./vote part3/*clean | sort -rnk3 | head -20 ; rm -f part3/*clean
30for x in part3/*txt ; do cat $x | awk '{ print $2,$8 }' >| $x.clean; done ; ./vote part3/*clean | sort -rnk3 | head -20 ; rm -f part3/*clean
31for x in part4/*txt ; do cat $x | awk '{ print $2,$4 }' >| $x.clean; done ; ./vote part4/*clean | sort -rnk3 | head -20 ; rm -f part4/*clean
32for x in part4/*txt ; do cat $x | awk '{ print $2,$8 }' >| $x.clean; done ; ./vote part4/*clean | sort -rnk3 | head -20 ; rm -f part4/*clean
33
34# Mean voting for part 3 and 4
35cat part3/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part3/* | awk '{ a+=$4; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
36cat part3/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part3/* | awk '{ a+=$8; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
37cat part4/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part4/* | awk '{ a+=$4; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
38cat part4/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part4/* | awk '{ a+=$8; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
39
40# Clever stuff (or not)
41cat part3/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part3/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part3/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$4; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
42cat part3/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part3/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part3/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$8; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
43cat part4/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part4/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part4/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$4; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
44cat part4/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part4/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part4/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$8; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
45
46# Plot lena displacement
47set contour
48unset surface
49set view 0,0
50set cntrparam levels discrete 0.31, 0.35, 0.42, 0.52, 0.7, 1, 1.5
51set xrange [-1:1]
52set yrange [1:-1]
53set mxtics 2
54set mytics 2
55set size square
56set xzeroaxis
57set yzeroaxis
58set xlabel "dx" font "Italic,32"
59splot 'part0/lena-values.txt' with lines
60
61
62#set border 0
63set style line 1 lt 1 lw 1
64set style line 2 lt 2 lw 1
65set style line 3 lt 3 lw 1
66set style line 4 lt 6 lw 1
67set style line 5 lt 1 lw 3
68set style line 6 lt 2 lw 3
69set style line 7 lt 3 lw 3
70set style line 8 lt 6 lw 3
71###
72###
73###
74###
75###  Stuff below here is deprecated or unsorted
76###
77###
78###
79###
80
81#% find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].???' | rev | sort -k2 -t. | rev | xargs -n 1 ./main | tee fs-4chan.txt
82#% find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].???' | rev | sort -k2 -t. | rev | xargs -n 1 ./main-jajuni | tee jajuni-4chan.txt
83#% cat /tmp/4chanlist.txt | xargs -n 1 ./main | tee -a fs-4chan.txt
84
85# Lena
86set hidden3d
87set grid
88unset colorbox
89splot "lena-min.txt" with lines lc 7 notitle
90set terminal epslatex color size 2.5,2 blacktext
91set tmargin screen 0.75
92set bmargin screen 0.25
93set lmargin screen 0.05
94set rmargin screen 0.95
95set output "lena-min.tex"
96splot "lena-min.txt" with lines lc 7 notitle
97unset output
98set term pop
99
100# Dans gnuplot
101set xrange [-.1:.4]
102set yrange [.45:-.05]
103set grid
104plot "fs-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
105     "fs-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
106     "fs-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI", \
107     "fs-jylam.txt" using 6:7 lc 4 pt 7 ps .08 title "Jylam", \
108     "merge.txt" using 5:6 lc 7 ps .2 with lines
109#plot "fs-textures.txt" using 6:7 lc 3 pt 7 ps .2, "fs-aerials.txt" using 6:7 lc 3 pt 7 ps .2, "fs-misc.txt" using 6:7 lc 7 pt 7 ps .2, "fs-4chan.txt" using 6:7 lc 1 pt 7 ps .2
110
111# Histogramme de la tache Floyd-Steinberg
112sed -ne 's/.* for //p' fs-*txt | ./xy2d >| histo-fs.txt
113# Et ensuite dans gnuplot:
114set xrange [-.1:.4]
115set yrange [.4:-.1]
116set grid
117set lmargin screen 0.05
118set bmargin screen 0.15
119set tmargin screen 0.95
120set rmargin screen 0.95
121unset colorbox
122set pm3d explicit map interpolate 1.8,1.8
123set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
124unset key
125#splot "histo-fs.txt" notitle
126set terminal epslatex color size 1.8,1.8 blacktext
127set output "fs-histo.tex"
128splot "histo-fs.txt" notitle
129unset output
130set term pop
131
132set xrange [-.1:.9]
133set yrange [.95:-.05]
134set grid
135plot "jajuni-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
136     "jajuni-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
137     "jajuni-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
138
139# Histogramme de la tache JaJuNi
140sed -ne 's/.* for //p' jajuni*txt | ./xy2d-jajuni >| histo-jajuni.txt
141# Et ensuite dans gnuplot:
142set xrange [-.1:.9]
143set yrange [.9:-.1]
144set grid
145set lmargin screen 0.05
146set bmargin screen 0.15
147set tmargin screen 0.95
148set rmargin screen 0.95
149unset colorbox
150set pm3d explicit map interpolate 1.8,1.8
151set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
152unset key
153#splot "histo-jajuni.txt" notitle
154set terminal epslatex color size 1.8,1.8 blacktext
155set output "jajuni-histo.tex"
156splot "histo-jajuni.txt" notitle
157unset output
158set term pop
159
160# Test de merde
161set xrange [0:5]
162set yrange [0:5]
163set grid
164plot "fs-uscsipi.txt" using 2:4 lc 1 pt 7 ps .5, "fs-4chan.txt" using 2:4 lc 7 pt 7 ps .5, "fs-tobefred.txt" using 2:4 lc 3 pt 7 ps .5
165
166# Ostromoukhov
167set xrange [-.2:.2]
168set yrange [.3:-.1]
169set grid
170plot "ostro-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
171     "ostro-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
172     "ostro-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
173
174# Histogramme de la tache Ostro
175sed -ne 's/.* for //p' ostro*txt | ./xy2d-ostro >| histo-ostro.txt
176# Et ensuite dans gnuplot:
177set xrange [-.2:.2]
178set yrange [.3:-.1]
179set grid
180set lmargin screen 0.05
181set bmargin screen 0.15
182set tmargin screen 0.95
183set rmargin screen 0.95
184unset colorbox
185set pm3d explicit map interpolate 1.8,1.8
186set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
187unset key
188splot "histo-ostro.txt" notitle
189set terminal epslatex color size 1.8,1.8 blacktext
190set output "ostro-histo.tex"
191splot "histo-ostro.txt" notitle
192unset output
193set term pop
194
195# Optimum
196set xrange [-.5:.2]
197set yrange [.6:-.1]
198set grid
199plot "optimum-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
200     "optimum-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
201     "optimum-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
202
203# Histogramme de la tache Optimum
204sed -ne 's/.* for //p' optimum*txt | ./xy2d-optimum >| histo-optimum.txt
205# Et ensuite dans gnuplot:
206set xrange [-.5:.2]
207set yrange [.6:-.1]
208set grid
209set lmargin screen 0.05
210set bmargin screen 0.15
211set tmargin screen 0.95
212set rmargin screen 0.95
213unset colorbox
214set pm3d explicit map interpolate 1.8,1.8
215set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
216unset key
217splot "histo-optimum.txt" notitle
218set terminal epslatex color size 1.8,1.8 blacktext
219set output "optimum-histo.tex"
220splot "histo-optimum.txt" notitle
221unset output
222set term pop
223
224# Serpentine Optimum
225set xrange [-.3:.3]
226set yrange [.5:-.1]
227set grid
228plot "serpopt-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
229     "serpopt-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
230     "serpopt-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
231
232# Histogramme de la tache Serpentine Optimum
233sed -ne 's/.* for //p' serpopt*txt | ./xy2d-serpopt >| histo-serpopt.txt
234# Et ensuite dans gnuplot:
235set xrange [-.3:.3]
236set yrange [.6:-.1]
237set grid
238set lmargin screen 0.05
239set bmargin screen 0.15
240set tmargin screen 0.95
241set rmargin screen 0.95
242unset colorbox
243set pm3d explicit map interpolate 1.8,1.8
244set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
245unset key
246splot "histo-serpopt.txt" notitle
247set terminal epslatex color size 1.8,1.8 blacktext
248set output "serpopt-histo.tex"
249splot "histo-serpopt.txt" notitle
250unset output
251set term pop
252
253# Combinaison jajuni / floyd-steinberg
254set xrange [-.1:.4]
255set yrange [.9:-.1]
256set grid
257plot "fs-4chan.txt" using 6:7 lc 2 pt 7 ps .1 title "Floyd-Steinberg", "jajuni-tobefred.txt" using 6:7 lc 1 pt 7 ps .1 title "Jarvis-Judice-Ninke"
258
259######################## Trucs en cours ########################
260
261# Lancés sur canard:
262boat.png elaine.png texture[2345].png
263
264# Lancés sur poulet :
265./main /var/www/net/tobefred/www/htdocs/media/romane_bohringer.jpg | tee out-bohringer.txt ; ./main /var/www/net/tobefred/www/htdocs/media/juliette_binoche_05.jpg | tee out-binoche.txt ; ./main /var/www/net/tobefred/www/htdocs/media/kate_beckinsale02.jpg | tee out-beckinsale.txt
266
267#### Pour les out-*
268scp canard.zoy.org:out-'*'.txt .
269for x in out-*.txt; do sort -k7 $x | head -20 ; done | cut -f1 -d: | sort | uniq -c | sort -n
270
271###
272### Conversion du vieux format de résultats (deprecated)
273cat -n $x | sed 's/^  *[0-9]*\([0-9]\)[[:space:]]*/[\1] /; s/....###/###/; s/\[[27]/[1/; s/\[[38]/[2/; s/\[[49]/[3/; s/\[[50]/[4/'
274
275#
Note: See TracBrowser for help on using the repository browser.