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