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

Contents of /eyes/cassidi.txt

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.5