/[opencvs]/eyes/qi.txt
ViewVC logotype

Contents of /eyes/qi.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Mon Oct 6 06:46:38 2014 UTC (3 years, 9 months ago) by hib
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
Added more stuff - just in case, the old_eyes is in /b/archive/2014
1 from antique
2
3 step 1 convert to i
4
5 step 2. - from i, convert to smaller .png in j - not 16 bit - 8 bit
6 Step 3 - in j, draw green circles around all the important parts
7 Step 4 - make k using analuze_green_area from j
8 Step 5 - figure out the color aread isong compute_cyclone_averages - similar to eyes.c - except that there are up to 255 variations
9 sepending on the strenght of the color;
10
11
12 h - original sources NOT (too big)
13 i - sources - converted to png and made smaller - for easier green line drawing ( 1/64 are, 1/8 width)
14
15
16
17 j - png files - with a green line around the important bit
18 ls | awk '{print "convert " $1 " ../j/" $1'} | bash
19
20 k - 16 bit alpha mask based on the image
21 kbad - ???
22 m - ??
23 other_possible_tops - other possible top pages
24 ri - rotated image at 512x512 - well this is not rotated here because of the image
25 rk - rotated alpha at 512x512
26 I think this size was designed to pick the image.
27
28
29
30
31
32
33
34 cd h
35 mkdir ../i
36 ls *.png | awk '{print "convert " $1 " -resize 12.5%x12.5% ../i/" $1}'
37
38
39 cd j
40 mkdir ../k
41 ls | awk '{print "analyze_green_area " $1 " ../k/" $1}' | bash
42
43
44
45
46
47
48
49 field 1 2 11 12 13 <tiles.txt | awk -F \| '
50 BEGIN {
51 print "# ImageMagick pixel enumeration: 16,16,255,rgb";
52 }
53 {
54 print $1 "," $2 ": (" $3 "," $4 "," $5 ")";
55 }
56 ' | convert txt: squared.png
57
58 The above is used to figure out the order of point placement.
59
60
61 Block out ( and do later)
62 7,3
63 7,4
64 8,3
65 8,4
66
67
68
69 Start at
70 7,6
71 7,11
72 3,6
73 11,10
74 7,14
75
76 OK - modify points.c as per above:
77
78
79 points | sort >points.txt
80
81
82
83 bash analyze_source_image.sh squared.png >source.txt
84
85
86
87
88 cp tiles.txt source_frames.txt
89
90 bash analyze_source_image.sh squared.png >source.txt
91
92
93
94 cd k
95 ls >../choices.txt
96 cd ..
97 cp choices.txt original_choices.txt
98
99
100 # rotate some images the right way - in i and j and k
101 # shpould have done this earlier
102 convert 407195_309585259086745_176138304_n.png -rotate 90 a.png && mv a.png 407195_309585259086745_176138304_n.png
103 convert 249779_203525443026061_2251986_n.png -rotate 90 a.png && mv a.png 249779_203525443026061_2251986_n.png
104
105 convert 385902_273937079318230_31662780_n.png -rotate 90 a.png && mv a.png 385902_273937079318230_31662780_n.png
106
107 Find analysis of pictures
108 cd i
109 compute_all_averages.sh >../analysis.txt
110
111 !!!!!!edit analysis.txt - change ./ to nothing
112
113 note - this was done in h for antique, as the size in i was smaller, but the filenames are different fro qi and i has () so
114
115
116
117
118
119
120
121 # now make the ri stuff
122 mkdir ri
123 cd ri
124 field 1 1 4 5 6 <../analysis.txt | awk -F \| '
125 {
126 print "convert ../i/" $2 " -background \#" $3 $4 $5 " -resize 512x512 -extent 512x512 ../ri/" $1 ;
127 }
128 ' | bash multiproc.sh bash
129 cd ..
130
131
132 # now make the rk stuff
133 mkdir rk
134 cd rk
135 field 1 1 4 5 6 <../analysis.txt | awk -F \| '
136 {
137 print "convert ../k/" $2 " -background \#000000 -resize 512x512 -extent 512x512 ../rk/" $1 ;
138 }
139 ' | bash multiproc.sh bash
140 cd ..
141
142
143
144
145
146 !* OK at this point we have source_frames.txt holding the information on each frame, and we are doing 256
147 Now we need to find the best match for each square.
148
149
150 awk -F '|' <points.txt '{printf ("bash $e/analyze_looking_for_best_frame.sh %3.3d %3.3d %3.3d 20\n",$1,$2,$3)}' > work_all.txt
151 cp work_all.txt work_todo.txt
152
153
154
155
156
157 Original source 1920x2560
158
159 20880x27840 - 480 dpi
160 convert 0630131502a.png -resize 20880x27840 01_source_480_size.png
161
162
163 # need to turn SCALE on and set it to 20880x27840 for both tilify and tilify_cyclone
164 # or, we need to read the full source, somtehing that will take a day or so, 100 times the amount of time
165 {
166 rm -f 2>/dev/null /tmp/oo1
167 rm -f 2>/dev/null /tmp/oo2
168 mknod /tmp/oo1 p
169 mknod /tmp/oo2 p
170 bash analyze_source_image.sh source/0630131502a.png | tee /tmp/oo1 | tee /tmp/oo2 >02_source_cleaned.txt &
171 tilify_cyclone 1920 2560 30 4 /tmp/oo1 >tiles.txt &
172 time tilify 1920 2560 30 4 /tmp/oo2 | tee tilified.txt | convert txt: tilified.png &
173 wait
174 }
175
176 #note we made tilified_small.png before setting scale at the original source image
177
178
179
180
181
182
183
184 so it looks good.
185
186
187
188 bash analyze_source_image.sh squared.png >source.txt
189
190
191
192
193
194 !* OK at this point we have source_frames.txt holding the information on each frame, and we are doing 177 pictures by selectively
195 blocking some outer edge ones
196 and a few inner ones.
197 Now we need to find the best match for each square.
198
199
200
201
202
203 mkdir s
204 cd s
205
206
207
208 grep '^010|004' ../source_frames.txt | \
209 awk -F '|' \
210 '{print "convert -size " $24 "x" $25 " xc:black -stroke white -fill white -draw '\''polygon " \
211 $14 "," $15 " " $16 "," $17 " " $20 "," $21 " " $18 "," $19 "'\'' a.png"}' | bash
212
213 echo "cat choices.txt | " `grep '^010|004' ../source_frames.txt | awk -F '|' '{print "bash multiproc.sh cyclone_pick a.png " $11 " " $12 " " $13 " 2000" }'` \
214 "| sort | tee first.txt | head -100 | " \
215 `grep '^010|004' ../source_frames.txt | awk -F '|' '{print "cyclone_pick a.png " $11 " " $12 " " $13 " 2000" }'`
216
217
218 Then you pick the best one.
219
220 echo "4f21201993833ee65b923958c1947a05.png" | cyclone_pick a.png 162 133 123 100000 | sort | tee second.txt | head -50 | cyclone_pick a.png 162 133 123 100000
221
222 echo `grep '^010|004' ../source_frames.txt`"|4f21201993833ee65b923958c1947a05.png-194.957031|-145.340332|3.457551" >>final_frames.txt
223
224
225 # remove a line from points.txt
226 # remove a 4f21 from choices.txt
227 rm *.png
228
229
230 /* note - to redo choices exclusion:
231 field 26 <final_frames.txt | awk '{print "grep -v " $1 " <../s/choices.txt >l;mv l choices.txt"}' | bash
232 */
233
234
235 this is the selection script - we ran 2 copies - one isn as and one in s2
236 s has the main files. s2 was the secondary. This sped up the very very very long process.
237 vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
238 export A="015|010"
239 export CHOICE=NONO
240 export FINAL_CHOICE=NONO
241 grep '^'$A ../source_frames.txt | \
242 awk -F '|' \
243 '{print "convert -size " $24 "x" $25 " xc:black -stroke white -fill white -draw '\''polygon " \
244 $14 "," $15 " " $16 "," $17 " " $20 "," $21 " " $18 "," $19 "'\'' a.png"}' | bash
245
246 export RGB=`grep '^'$A ../source_frames.txt |awk -F '|' '{print $11 " " $12 " " $13 }'`
247
248 cat ../s/choices.txt |bash multiproc.sh cyclone_pick a.png $RGB 2500 | sort | tee first.txt | head -100 | bash multiproc.sh cyclone_pick a.png $RGB 2500
249
250 #Then you pick the best one.
251
252 export CHOICE=`head -1 |awk -F '_' '{print $4}'`
253 000000000000317445_290.000000_483.058593_2bad261905c437c227df92ba9c3c0888.png_-250.838379_-119.383789_2.895593.png
254
255 grep -v $CHOICE <../s/choices.txt >l
256 mv l ../s/choices.txt
257
258 rm 000*.png
259 echo $CHOICE | cyclone_pick a.png $RGB 100000 | sort | tee second.txt | head -50 | cyclone_pick a.png $RGB 100000
260
261
262
263 export FINAL_CHOICE=`awk -F '_' '{print $4 "|" $5 "|" $6 "|" $7; exit; }'`
264 000000000000399875_312.000000_550.028740_2bad261905c437c227df92ba9c3c0888.png_-259.676758_-125.611816_2.944895.png
265
266
267 export FINAL_CHOICE=`echo $FINAL_CHOICE | sed 's/.png$//g'`
268
269 echo >>../s/final_frames.txt `grep '^'$A ../source_frames.txt`\|"$FINAL_CHOICE"
270
271 # remove a line from points.txt
272 rm *.png
273
274
275
276 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^6
277 Selection script ^^^^^^
278
279
280
281 # note - this will not work because we are missing some tiles.
282 sort <final_frames.txt >final_frames_sorted.txt
283
284 cd ri
285
286 export MAGICK_TMPDIR=/t/tmp
287 montage -limit memory 6000000000 -limit map 6000000000 `field 26 <../final_frames_sorted.txt` -geometry 512x512+0+0 -tile 16x16 ../test.png
288
289
290
291
292 final_frames.txt has the following format:
293
294 (0-24 from tilify.c rest from picking with cyclone_pick.c )
295
296 0 1 X (or column)
297 1 2 Y (or row)
298 2 3 top left x - in real coordinates
299 3 4 top left y - in real coordinates
300 4 5 Top right x - in real coordinates
301 5 6 top right y - in real coodrindates
302 6 7 bottom left x - in real coordinates
303 7 8 bottom left y - in real coordinates
304 8 9 bottom right x - in real coordinates
305 9 10 bottom right y - in real coordinates
306 10 11 R color - 0-255
307 11 12 g color - 0-255
308 12 13 b color - 0-255
309 13 14 top left x - in local coordinates
310 14 15 top left y - in local coordinates
311 15 16 top right x - in local coordiantes
312 16 17 top right y - in local coordinates
313 17 18 bottom left x - in local coordinates
314 18 19 bottom left y - in local coordinates
315 19 20 bottom right x - in local coordinates
316 20 21 bottom right y - in local coodinates
317 21 22 x offset to place the local to global
318 22 23 y offset ...
319 23 24 width
320 24 25 height
321 25 26 filename.ext
322 26 27 shift xoffset
323 27 28 shift yoffset
324 28 29 shift scale
325
326
327
328
329 vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
330 Make the squares
331 blur is 0x16 for 512
332 and 0x256 for 8192
333
334 mkdir r
335 cd r
336
337 # make the r files for input
338 awk <../final_frames_sorted.txt -F '|' \
339 '{print "convert -size " $24 "x" $25 " xc:black -stroke white -fill white -draw '\''polygon " \
340 $14 "," $15 " " $16 "," $17 " " $20 "," $21 " " $18 "," $19 "'\'' -blur 0x75 " $1 "_" $2 "_a.png" }' | bash
341 ^^^ That was before - but the blur got clipped - so we added a 75x75 border
342
343 # not this one - 75 was used for cyclone. We use 25
344 #awk <../final_frames_sorted.txt -F '|' \
345 #'{print "convert -size " ($24+75+75) "x" ($25+75+75) " xc:black -stroke white -fill white -draw '\''polygon " \
346 #($14+75) "," ($15+75) " " ($16+75) "," ($17+75) " " ($20+75) "," ($21+75) " " ($18+75) "," ($19+75) "'\'' -blur 0x75 " $1 "_" $2 "_a.png" }' | bash multiproc.sh bash
347
348
349 awk <../final_frames_sorted.txt -F '|' \
350 '{print "convert -size " ($24+25+25) "x" ($25+25+25) " xc:black -stroke white -fill white -draw '\''polygon " \
351 ($14+25) "," ($15+25) " " ($16+25) "," ($17+25) " " ($20+25) "," ($21+25) " " ($18+25) "," ($19+25) "'\'' -blur 0x25 " $1 "_" $2 "_a.png" }' | bash multiproc.sh bash
352
353 cyclone_build <../final_frames_sorted.txt
354 # the above one creates the memory.txt
355
356 # - not- had to modify cyclone_build to be cyclone_build_small - 512 instead of 8192 and other things.
357
358 time cyclone_build a <../final_frames_sorted.txt |fsort 8000000000 | combinify 20880 27840 776 >c.txt
359 time convert c.txt c.png
360
361
362
363
364
365
366
367
368 ------------------------------
369
370 Make the big sizes
371
372 mkdir rough
373 mv r ri rk rough
374
375 mkdir big
376 cd big
377 mkdir r
378 mkdir ri
379
380
381 # make full size images
382
383 field 26 26 11 12 13 <../final_frames_sorted.txt | awk -F \| '
384 {
385 printf "%s%X%X%X%s","convert ../i/" $2 " -background \#",$3,$4,$5," -resize 8192x8192 -extent 8192x8192 ri/" $1;print "";
386
387 }
388 ' | bash multiproc.sh bash
389
390
391
392 # now make the rk stuff
393 mkdir rk
394 field 1 1 4 5 6 <../analysis.txt | awk -F \| '
395 {
396 print "convert ../k/" $2 " -background \#000000 -resize 8192x8192 -extent 8192x8192 rk/" $1 ;
397 }
398 ' | bash multiproc.sh bash
399
400
401
402 cd big
403 perl convert_final_frames.pl <../final_frames_sorted.txt > final_frames_sorted.txt
404 # not changed the scale to 1-1 because we are full scale input.
405 # there are multiple scales in the convert perl script.
406
407
408 mkdir r
409 cd r
410 # test it out
411 awk <../final_frames_sorted.txt -F '|' \
412 '{print "convert -size " $24 "x" $25 " xc:black -stroke white -fill white -draw '\''polygon " \
413 $14 "," $15 " " $16 "," $17 " " $20 "," $21 " " $18 "," $19 "'\'' -blur 0x32 " $1 "_" $2 "_a.png" }' | bash
414 # not multiproc.sh bash does not help because this does the work with smp
415
416
417
418 # make the r files
419 time cyclone_build_big <../final_frames_sorted.txt
420
421
422
423
424 time cat <../final_frames_sorted.txt | cyclone_build_big a | fsort 8000000000 | combinify 20880 27840 776 >c.txt
425
426
427 vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
428
429 mkdir t
430 cd t
431 time cat <../final_frames_sorted.txt | cyclone_build a | fsort 9000000000 | combinify 31200 41600 72 >c.txt
432
433 combinify - could actually output it to convert
434 Note -hard coded cyclone_build to be 6600x8800
435 Note2 - final will be 31200x41600 which is 43.3333333 x 57.77777777777
436
437 some pixels are missing so have to convert it:
438 time convert c.txt c.png
439 time analyze_source_image.sh c.png >../pixel_final.txt
440
441
442 ---------------------------------------
443 Hologram
444
445 cd source
446 analyze_source_image.sh holoham_points_480.png >hologram_find2.txt
447 # note the fast image did not work
448
449
450 grep '0|255|0' hologram_find2.txt | tee points1.txt
451 # then edit points1.txt to clean up
452
453 #then
454 awk -F '|' <points1.txt '{print $1 "|" $2 "|0.5589|1|8.41e-07|0.13"
455 }' >../points.txt
456
457
458
459 cd big
460 mkdir holo
461 cd holo
462 cp ../../points.txt .
463
464 mkdir u
465
466
467 perl $e/qi_blocks.pl >m1
468 flip_flop <m1 >o1 2>o2 3>o3 4>o4 5>o5 5
469 time bash o1 &
470 time bash o2 &
471 time bash o3 &
472 time bash o4 &
473 time bash o5 &
474 wait
475
476 find_grey_range real u/*_018.fp >tfull.grey
477
478
479 ls u/*.fp | awk '{print "fp_to_txt real 720 960 tfull.grey " $1 " | convert txt: " $1 ".png"}' >n
480 flip_flop <n >o1 2>o2 3>o3 4>o4 5>o5 6>o6 5
481 time bash o1 &
482 time bash o2 &
483 time bash o3 &
484 time bash o4 &
485 time bash o5 &
486 wait
487
488
489 mkdir v
490
491 time montage -limit memory 1000000000 -limit map 1000000000 u/es_000_*.png -geometry 720x960+0+0 -tile 29x1 v/es_000.png
492 time montage -limit memory 1000000000 -limit map 1000000000 u/es_001_*.png -geometry 720x960+0+0 -tile 29x1 v/es_001.png
493 time montage -limit memory 1000000000 -limit map 1000000000 u/es_002_*.png -geometry 720x960+0+0 -tile 29x1 v/es_002.png
494 time montage -limit memory 1000000000 -limit map 1000000000 u/es_003_*.png -geometry 720x960+0+0 -tile 29x1 v/es_003.png
495 time montage -limit memory 1000000000 -limit map 1000000000 u/es_004_*.png -geometry 720x960+0+0 -tile 29x1 v/es_004.png
496 time montage -limit memory 1000000000 -limit map 1000000000 u/es_005_*.png -geometry 720x960+0+0 -tile 29x1 v/es_005.png
497 time montage -limit memory 1000000000 -limit map 1000000000 u/es_006_*.png -geometry 720x960+0+0 -tile 29x1 v/es_006.png
498 time montage -limit memory 1000000000 -limit map 1000000000 u/es_007_*.png -geometry 720x960+0+0 -tile 29x1 v/es_007.png
499 time montage -limit memory 1000000000 -limit map 1000000000 u/es_008_*.png -geometry 720x960+0+0 -tile 29x1 v/es_008.png
500 time montage -limit memory 1000000000 -limit map 1000000000 u/es_009_*.png -geometry 720x960+0+0 -tile 29x1 v/es_009.png
501
502
503 time montage -limit memory 1000000000 -limit map 1000000000 u/es_010_*.png -geometry 720x960+0+0 -tile 29x1 v/es_010.png
504 time montage -limit memory 1000000000 -limit map 1000000000 u/es_011_*.png -geometry 720x960+0+0 -tile 29x1 v/es_011.png
505 time montage -limit memory 1000000000 -limit map 1000000000 u/es_012_*.png -geometry 720x960+0+0 -tile 29x1 v/es_012.png
506 time montage -limit memory 1000000000 -limit map 1000000000 u/es_013_*.png -geometry 720x960+0+0 -tile 29x1 v/es_013.png
507 time montage -limit memory 1000000000 -limit map 1000000000 u/es_014_*.png -geometry 720x960+0+0 -tile 29x1 v/es_014.png
508 time montage -limit memory 1000000000 -limit map 1000000000 u/es_015_*.png -geometry 720x960+0+0 -tile 29x1 v/es_015.png
509 time montage -limit memory 1000000000 -limit map 1000000000 u/es_016_*.png -geometry 720x960+0+0 -tile 29x1 v/es_016.png
510 time montage -limit memory 1000000000 -limit map 1000000000 u/es_017_*.png -geometry 720x960+0+0 -tile 29x1 v/es_017.png
511 time montage -limit memory 1000000000 -limit map 1000000000 u/es_018_*.png -geometry 720x960+0+0 -tile 29x1 v/es_018.png
512 time montage -limit memory 1000000000 -limit map 1000000000 u/es_019_*.png -geometry 720x960+0+0 -tile 29x1 v/es_019.png
513
514 time montage -limit memory 1000000000 -limit map 1000000000 u/es_020_*.png -geometry 720x960+0+0 -tile 29x1 v/es_020.png
515 time montage -limit memory 1000000000 -limit map 1000000000 u/es_021_*.png -geometry 720x960+0+0 -tile 29x1 v/es_021.png
516 time montage -limit memory 1000000000 -limit map 1000000000 u/es_022_*.png -geometry 720x960+0+0 -tile 29x1 v/es_022.png
517 time montage -limit memory 1000000000 -limit map 1000000000 u/es_023_*.png -geometry 720x960+0+0 -tile 29x1 v/es_023.png
518 time montage -limit memory 1000000000 -limit map 1000000000 u/es_024_*.png -geometry 720x960+0+0 -tile 29x1 v/es_024.png
519 time montage -limit memory 1000000000 -limit map 1000000000 u/es_025_*.png -geometry 720x960+0+0 -tile 29x1 v/es_025.png
520 time montage -limit memory 1000000000 -limit map 1000000000 u/es_026_*.png -geometry 720x960+0+0 -tile 29x1 v/es_026.png
521 time montage -limit memory 1000000000 -limit map 1000000000 u/es_027_*.png -geometry 720x960+0+0 -tile 29x1 v/es_027.png
522 time montage -limit memory 1000000000 -limit map 1000000000 u/es_028_*.png -geometry 720x960+0+0 -tile 29x1 v/es_028.png
523
524
525
526
527
528 time convert -limit memory 10000000000 -limit map 10000000000 -append v/es_*.png hologram_final.png
529
530 time analyze_source_image.sh hologram_final.png >../hologram_final.txt
531
532
533 --------------------------------------
534
535
536
537
538
539
540
541
542 cd big
543 convert ../start.jpg -resize 8800x6600 -rotate 90 work_base.png
544
545 - clean up face on work_base.png
546
547 make alpha.png and convert the pic
548
549
550 analyze_source_image.sh alpha.png | clean_up_alpha 6600 8800 4333 | convert txt: alpha2.png
551
552 alpha2.png -> alpha3.png guassian blur 31 pixels wide RLE
553
554
555 Lets make bigger
556 time convert -limit memory 2000000000 -limit map 2000000000 alpha2.png -resize 20880x27840 txt: |\
557 analyze_source_image_filter >alpha_final.txt
558
559 cd ../srouce
560 analyze_source_image.sh
561
562
563
564 time randomify 20880 27840 439 pixel_final.txt base_final.txt alpha_final.txt hologram_final.txt | convert txt: final.png
565
566 It came out beautiful.
567
568
569
570
571
572 alpha:
573 tint green so we can fix the gaps
574 convert alpha1.png -fill green -tint 100 alpha2.png
575 # use gimp to make alpha as alpha3.png
576 convert alpha3.png alpha3.bmp
577 analyze_fast_image.sh alpha3.bmp >alpha3.txt
578 clean_up_alpha <alpha3.txt 7095 11273 42 | convert txt: alpha4.png
579 rm alpha3.txt
580 # use gimp to guassian blur alpha from alpha4 to alpha5
581 # of 20
582 analyze_source_image.sh alpha5.png >alpha5.txt
583
584
585 test small
586
587 cd rsmall2
588 analyze_source_image.sh small2.png >small2.txt
589 analyze_source_image.sh ../source/02_source_cleaned.png >base.txt
590 randomify 7095 11273 119 small2.txt base.txt ../alpha_work/alpha5.txt | convert txt: small_example.png
591

  ViewVC Help
Powered by ViewVC 1.1.5