source: research/2008-displacement/README @ 4838

Last change on this file since 4838 was 2293, checked in by Sam Hocevar, 12 years ago
  • Final version of the paper. Uploaded at the last minute, of course.
File size: 13.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# Results for part 1
8for x in 1 2 3 4; do
9    grep '^\['$x part1/dionoea.txt | awk '{ e+=$4; ef+=$7; em+=$10; n++ } END { print e/n, ef/n, em/n }' | read a1 b1 c1
10    grep '^\['$x part1/4chan.txt | awk '{ e+=$4; ef+=$7; em+=$10; n++ } END { print e/n, ef/n, em/n }' | read a2 b2 c2
11    echo $(((3 * $a1 + $a2) / 4)) $(((3 * $b1 + $b2) / 4)) $(((3 * $c1 + $c2) / 4))
12done
13
14# Condorcet voting for phase 2 results
15#  - raster + E
16#  - raster + E_min
17#  - serpentine + E
18#  - serpentine + E_min
19for 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
20for 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
21for 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
22for 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
23
24# Get phase 3 and phase 4 stuff
25# .. from canard
26ssh canard.zoy.org "cd test-20080329; tar cz *raster.txt" | tar xz
27ssh canard.zoy.org "cd test-20080329; tar cz *serp.txt" | tar xz
28for x in *-raster.txt; do y="$x"; y="${y%%-raster.txt}"; y="${y%%.tiff}"; y="${y##usc-sipi}"; \mv "$x" part3/"$y".txt; done
29for x in *-serp.txt; do y="$x"; y="${y%%-serp.txt}"; y="${y%%.tiff}"; y="${y##usc-sipi}"; \mv "$x" part4/"$y".txt; done
30# .. from poulet (cpushare)
31scp poulet.zoy.org:cpushare/'test*-*.txt' .
32for 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
33for 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
34
35# Condorcet voting for part 3 and 4
36for 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
37for 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
38for 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
39for 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
40
41# Mean voting for part 3 and 4
42# Square mean voting is not interesting
43cat 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
44cat 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
45cat 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
46cat 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
47
48# root square mean voting... why not, after all?
49cat part3/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part3/* | awk '{ a+=sqrt($4); dx+=$10; dy+=$12; n+=1 } END { print (a/n)*(a/n), dx/n, dy/n }')"; done | sort -nk2 | head -20
50cat part3/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part3/* | awk '{ a+=sqrt($8); dx+=$10; dy+=$12; n+=1 } END { print (a/n)*(a/n), dx/n, dy/n }')"; done | sort -nk2 | head -20
51cat part4/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part4/* | awk '{ a+=sqrt($4); dx+=$10; dy+=$12; n+=1 } END { print (a/n)*(a/n), dx/n, dy/n }')"; done | sort -nk2 | head -20
52cat part4/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part4/* | awk '{ a+=sqrt($8); dx+=$10; dy+=$12; n+=1 } END { print (a/n)*(a/n), dx/n, dy/n }')"; done | sort -nk2 | head -20
53
54# Clever stuff (or not)
55cat 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
56cat 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
57cat 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
58cat 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
59
60# Plot lena displacement
61set contour
62unset surface
63set view 0,0
64set cntrparam levels discrete 0.31, 0.35, 0.42, 0.52, 0.7, 1, 1.5
65set xrange [-1:1]
66set yrange [1:-1]
67set mxtics 2
68set mytics 2
69set xlabel "$dx$"
70set ylabel "$dy$"
71unset mztics
72unset ztics
73set size square
74set xzeroaxis
75set yzeroaxis
76set lmargin screen 0.0 #.05
77set bmargin screen 0.2 # .15
78set tmargin screen 0.9 #.95
79set rmargin screen 0.9 #.95
80set terminal epslatex color size 5,2 blacktext
81unset colorbox
82#set lmargin 0.05
83#set rmargin 0.95
84#splot 'part0/lena-values.txt' with lines
85set output "lena-values.tex"
86splot '../part0/lena-values.txt' with lines lw 3 notitle
87unset output
88set term pop
89
90
91#set border 0
92set style line 1 lt 1 lw 1
93set style line 2 lt 2 lw 1
94set style line 3 lt 3 lw 1
95set style line 4 lt 6 lw 1
96set style line 5 lt 1 lw 3
97set style line 6 lt 2 lw 3
98set style line 7 lt 3 lw 3
99set style line 8 lt 6 lw 3
100###
101###
102###
103###
104###  Stuff below here is deprecated or unsorted
105###
106###
107###
108###
109
110#% 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
111#% 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
112#% cat /tmp/4chanlist.txt | xargs -n 1 ./main | tee -a fs-4chan.txt
113
114# Lena
115set hidden3d
116set grid
117unset colorbox
118splot "lena-min.txt" with lines lc 7 notitle
119set terminal epslatex color size 2.5,2 blacktext
120set tmargin screen 0.75
121set bmargin screen 0.25
122set lmargin screen 0.05
123set rmargin screen 0.95
124set output "lena-min.tex"
125splot "lena-min.txt" with lines lc 7 notitle
126unset output
127set term pop
128
129# Dans gnuplot
130set xrange [-.1:.4]
131set yrange [.45:-.05]
132set grid
133plot "fs-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
134     "fs-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
135     "fs-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI", \
136     "fs-jylam.txt" using 6:7 lc 4 pt 7 ps .08 title "Jylam", \
137     "merge.txt" using 5:6 lc 7 ps .2 with lines
138#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
139
140# Histogramme de la tache Floyd-Steinberg
141sed -ne 's/.* for //p' fs-*txt | ./xy2d >| histo-fs.txt
142# Et ensuite dans gnuplot:
143set xrange [-.1:.4]
144set yrange [.4:-.1]
145set xlabel "$dx$"
146set ylabel "$dy$"
147set grid
148set lmargin screen 0.05
149set bmargin screen 0.25
150set tmargin screen 0.95
151set rmargin screen 0.95
152unset colorbox
153set pm3d explicit map interpolate 1.8,1.8
154set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
155unset key
156#splot "../../subblock/histo-fs.txt" notitle
157set terminal epslatex color size 1.8,2.0 blacktext
158set output "fs-histo.tex"
159splot "../../subblock/histo-fs.txt" notitle
160unset output
161set term pop
162
163set xrange [-.1:.9]
164set yrange [.95:-.05]
165set grid
166plot "jajuni-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
167     "jajuni-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
168     "jajuni-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
169
170# Histogramme de la tache JaJuNi
171sed -ne 's/.* for //p' jajuni*txt | ./xy2d-jajuni >| histo-jajuni.txt
172# Et ensuite dans gnuplot:
173set xrange [-.1:.9]
174set yrange [.9:-.1]
175set xlabel "$dx$"
176set ylabel "$dy$"
177set grid
178set lmargin screen 0.05
179set bmargin screen 0.25
180set tmargin screen 0.95
181set rmargin screen 0.95
182unset colorbox
183set pm3d explicit map interpolate 1.8,1.8
184set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
185unset key
186#splot "../../subblock/histo-jajuni.txt" notitle
187set terminal epslatex color size 1.8,2.0 blacktext
188set output "jajuni-histo.tex"
189splot "../../subblock/histo-jajuni.txt" notitle
190unset output
191set term pop
192
193# Test de merde
194set xrange [0:5]
195set yrange [0:5]
196set grid
197plot "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
198
199# Ostromoukhov
200set xrange [-.2:.2]
201set yrange [.3:-.1]
202set grid
203plot "ostro-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
204     "ostro-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
205     "ostro-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
206
207# Histogramme de la tache Ostro
208sed -ne 's/.* for //p' ostro*txt | ./xy2d-ostro >| histo-ostro.txt
209# Et ensuite dans gnuplot:
210set xrange [-.2:.2]
211set yrange [.3:-.1]
212set xlabel "$dx$"
213set ylabel "$dy$"
214set xtics -.2,0.1
215set grid
216set lmargin screen 0.05
217set bmargin screen 0.25
218set tmargin screen 0.95
219set rmargin screen 0.95
220unset colorbox
221set pm3d explicit map interpolate 1.8,1.8
222set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
223unset key
224splot "../../subblock/histo-ostro.txt" notitle
225set terminal epslatex color size 1.8,2.0 blacktext
226set output "ostro-histo.tex"
227splot "../../subblock/histo-ostro.txt" notitle
228unset output
229set term pop
230
231# Optimum
232set xrange [-.5:.2]
233set yrange [.6:-.1]
234set grid
235plot "optimum-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
236     "optimum-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
237     "optimum-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
238
239# Histogramme de la tache Optimum
240sed -ne 's/.* for //p' optimum*txt | ./xy2d-optimum >| histo-optimum.txt
241# Et ensuite dans gnuplot:
242set xrange [-.5:.2]
243set yrange [.6:-.1]
244set xlabel "$dx$"
245set ylabel "$dy$"
246set grid
247set lmargin screen 0.05
248set bmargin screen 0.25
249set tmargin screen 0.95
250set rmargin screen 0.95
251unset colorbox
252set pm3d explicit map interpolate 1.8,1.8
253set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
254unset key
255splot "../../subblock/histo-optimum.txt" notitle
256set terminal epslatex color size 1.8,2.0 blacktext
257set output "optimum-histo.tex"
258splot "../../subblock/histo-optimum.txt" notitle
259unset output
260set term pop
261
262# Serpentine Optimum
263set xrange [-.3:.3]
264set yrange [.5:-.1]
265set grid
266plot "serpopt-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
267     "serpopt-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
268     "serpopt-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
269
270# Histogramme de la tache Serpentine Optimum
271sed -ne 's/.* for //p' serpopt*txt | ./xy2d-serpopt >| histo-serpopt.txt
272# Et ensuite dans gnuplot:
273set xrange [-.3:.3]
274set yrange [.6:-.1]
275set xlabel "$dx$"
276set ylabel "$dy$"
277set grid
278set lmargin screen 0.05
279set bmargin screen 0.25
280set tmargin screen 0.95
281set rmargin screen 0.95
282unset colorbox
283set pm3d explicit map interpolate 1.8,1.8
284set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
285unset key
286splot "../../subblock/histo-serpopt.txt" notitle
287set terminal epslatex color size 1.8,2.0 blacktext
288set output "serpopt-histo.tex"
289splot "../../subblock/histo-serpopt.txt" notitle
290unset output
291set term pop
292
293# Combinaison jajuni / Floyd-Steinberg
294set xrange [-.1:.4]
295set yrange [.9:-.1]
296set grid
297plot "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"
298
299######################## Trucs en cours ########################
300
301# Lancés sur canard:
302boat.png elaine.png texture[2345].png
303
304# Lancés sur poulet :
305./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
306
307#### Pour les out-*
308scp canard.zoy.org:out-'*'.txt .
309for x in out-*.txt; do sort -k7 $x | head -20 ; done | cut -f1 -d: | sort | uniq -c | sort -n
310
311###
312### Conversion du vieux format de résultats (deprecated)
313cat -n $x | sed 's/^  *[0-9]*\([0-9]\)[[:space:]]*/[\1] /; s/....###/###/; s/\[[27]/[1/; s/\[[38]/[2/; s/\[[49]/[3/; s/\[[50]/[4/'
314
315# Convert lena results to cropped detail
316convert output-7-3-5-1-serp.png -crop 160x160+32+160 crop-7-3-5-1-serp.png
317convert output-7-4-5-0-serp.png -crop 160x160+32+160 crop-7-4-5-0-serp.png
318
Note: See TracBrowser for help on using the repository browser.