Mercurial > lasercutter
view 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 |
line wrap: on
line source
1 (ns clojureDemo.MegaDeath)3 (import '(java.io File))4 (import '(org.apache.commons.io FileUtils))5 (import '(javax.imageio ImageIO) )7 (import '(ij.plugin PlugIn))8 (import '(ij ImagePlus IJ))10 (import '(ij Macro))12 (import '(java.io BufferedReader InputStreamReader))13 (import '(java.awt.image BufferedImage))17 (use '[clojureDemo.Xuggle :only (video-seq trans-save flash video-data display)])20 (use 'clojure.contrib.repl-utils)21 (use ['clojureDemo.Defines22 :only '(23 lian look getto human0 blow base app0 app1 app2 app3 app4 app524 bounce0 bounce1 bounce2 bounce3 bounce4 bounce5 bounce625 collide0 collide1 collide2 collide3 collide426 give0 give1 give2 give3 give4 target default)])29 (def hamster (first (video-seq look)))30 (def ham (.getImage hamster))32 (set! *print-length* 10)36 (defn final-ficker37 "wtf?"38 [& vars]39 (class (last vars)))41 (defmulti log-polar (fn [& args] (class (last args))))43 (defmethod log-polar clojure.lang.LazySeq44 ([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))))50 (defmethod log-polar ij.ImagePlus51 [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)))61 (defn x-polar262 [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" "")))71 (defn follow-object72 "takes in a video stream and does the most basic and simple forms of object detection."73 [video-seq]74 )86 (comment88 (do (use :reload-all 'clojureDemo.MegaDeath) (in-ns 'clojureDemo.MegaDeath))89 (map #(ns-unmap 'user %)(keys (ns-interns 'user)))90 )