annotate src/clojureDemo/MegaDeath.clj @ 12:aadb93318584

testing committ
author Robert McIntyre <rlm@mit.edu>
date Tue, 24 Aug 2010 19:10:22 -0400
parents 6d9bdaf919f7
children
rev   line source
rlm@1 1 (ns clojureDemo.MegaDeath)
rlm@1 2
rlm@1 3 (import '(java.io File))
rlm@1 4 (import '(org.apache.commons.io FileUtils))
rlm@1 5 (import '(javax.imageio ImageIO) )
rlm@1 6
rlm@1 7 (import '(ij.plugin PlugIn))
rlm@1 8 (import '(ij ImagePlus IJ))
rlm@1 9
rlm@1 10 (import '(ij Macro))
rlm@1 11
rlm@1 12 (import '(java.io BufferedReader InputStreamReader))
rlm@1 13 (import '(java.awt.image BufferedImage))
rlm@1 14
rlm@1 15
rlm@1 16
rlm@1 17 (use '[clojureDemo.Xuggle :only (video-seq trans-save flash video-data display)])
rlm@1 18
rlm@1 19
rlm@1 20 (use 'clojure.contrib.repl-utils)
rlm@1 21 (use ['clojureDemo.Defines
rlm@1 22 :only '(
rlm@1 23 lian look getto human0 blow base app0 app1 app2 app3 app4 app5
rlm@1 24 bounce0 bounce1 bounce2 bounce3 bounce4 bounce5 bounce6
rlm@1 25 collide0 collide1 collide2 collide3 collide4
rlm@1 26 give0 give1 give2 give3 give4 target default)])
rlm@1 27
rlm@1 28
rlm@1 29 (def hamster (first (video-seq look)))
rlm@1 30 (def ham (.getImage hamster))
rlm@1 31
rlm@1 32 (set! *print-length* 10)
rlm@1 33
rlm@1 34
rlm@1 35
rlm@1 36 (defn final-ficker
rlm@1 37 "wtf?"
rlm@1 38 [& vars]
rlm@1 39 (class (last vars)))
rlm@1 40
rlm@1 41 (defmulti log-polar (fn [& args] (class (last args))))
rlm@1 42
rlm@1 43 (defmethod log-polar clojure.lang.LazySeq
rlm@1 44 ([X Y video-seq]
rlm@1 45 (with-meta (map #(log-polar % X Y) video-seq) (meta video-seq)))
rlm@1 46 ([video-seq]
rlm@1 47 (with-meta (map #(log-polar %) video-seq) (meta video-seq))))
rlm@1 48
rlm@1 49
rlm@1 50 (defmethod log-polar ij.ImagePlus
rlm@1 51 [imageP]
rlm@1 52 (let [thread (Thread/currentThread)
rlm@1 53 options ""]
rlm@1 54 (.setName thread "Run$_polar-transform")
rlm@1 55 (Macro/setOptions thread options)
rlm@1 56 (IJ/runPlugIn imageP "clojureDemo.Polar_Transformer" "")
rlm@1 57 (let [return-image (IJ/getImage)]
rlm@1 58 (.hide return-image)
rlm@1 59 return-image)))
rlm@1 60
rlm@1 61 (defn x-polar2
rlm@1 62 [imageP]
rlm@1 63 (let [thread (Thread/currentThread)
rlm@1 64 options ""]
rlm@1 65 (.setName thread "Run$_polar-transform")
rlm@1 66 (Macro/setOptions thread options)
rlm@1 67 (IJ/runPlugIn imageP "clojureDemo.Polar_Transformer" "")))
rlm@1 68
rlm@1 69
rlm@1 70
rlm@1 71 (defn follow-object
rlm@1 72 "takes in a video stream and does the most basic and simple forms of object detection."
rlm@1 73 [video-seq]
rlm@1 74 )
rlm@1 75
rlm@1 76
rlm@1 77
rlm@1 78
rlm@1 79
rlm@1 80
rlm@1 81
rlm@1 82
rlm@1 83
rlm@1 84
rlm@1 85
rlm@1 86 (comment
rlm@1 87
rlm@1 88 (do (use :reload-all 'clojureDemo.MegaDeath) (in-ns 'clojureDemo.MegaDeath))
rlm@1 89 (map #(ns-unmap 'user %)(keys (ns-interns 'user)))
rlm@1 90 )