diff org/vision.org @ 172:04a39e6bb695

removed mega-import from cortex.vision
author Robert McIntyre <rlm@mit.edu>
date Sat, 04 Feb 2012 05:08:35 -0700
parents 15bde60217aa
children 22548d48cc85
line wrap: on
line diff
     1.1 --- a/org/vision.org	Sat Feb 04 05:02:25 2012 -0700
     1.2 +++ b/org/vision.org	Sat Feb 04 05:08:35 2012 -0700
     1.3 @@ -53,7 +53,9 @@
     1.4  (ns cortex.vision
     1.5    "Simulate the sense of vision in jMonkeyEngine3. Enables multiple
     1.6    eyes from different positions to observe the same world, and pass
     1.7 -  the observed data to any arbitray function."
     1.8 +  the observed data to any arbitray function. Automatically reads
     1.9 +  eye-nodes from specially prepared blender files and instanttiates
    1.10 +  them in the world as actual eyes."
    1.11    {:author "Robert McIntyre"}
    1.12    (:use (cortex world sense util))
    1.13    (:use clojure.contrib.def)
    1.14 @@ -61,13 +63,12 @@
    1.15    (:import (com.jme3.util BufferUtils Screenshots))
    1.16    (:import java.nio.ByteBuffer)
    1.17    (:import java.awt.image.BufferedImage)
    1.18 -  (:import com.jme3.renderer.ViewPort)
    1.19 +  (:import (com.jme3.renderer ViewPort Camera))
    1.20    (:import com.jme3.math.ColorRGBA)
    1.21    (:import com.jme3.renderer.Renderer)
    1.22 -  (:import com.jme3.scene.Node))
    1.23 -
    1.24 -(cortex.import/mega-import-jme3)
    1.25 -
    1.26 +  (:import com.jme3.app.Application)
    1.27 +  (:import com.jme3.texture.FrameBuffer)
    1.28 +  (:import (com.jme3.scene Node Spatial)))
    1.29  
    1.30  (defn vision-pipeline
    1.31    "Create a SceneProcessor object which wraps a vision processing
    1.32 @@ -178,11 +179,12 @@
    1.33      (bind-sense target cam)
    1.34      cam))
    1.35  
    1.36 -(def presets
    1.37 +(defvar color-channel-presets
    1.38    {:all    0xFFFFFF
    1.39     :red    0xFF0000
    1.40     :blue   0x0000FF
    1.41 -   :green  0x00FF00})
    1.42 +   :green  0x00FF00}
    1.43 +  "Bitmasks for common RGB color channels")
    1.44  
    1.45  (defn vision-fn
    1.46    "Returns a list of functions, each of which will return a color
    1.47 @@ -211,7 +213,7 @@
    1.48         (fn [[key image]]
    1.49           (let [whites (white-coordinates image)
    1.50                 topology (vec (collapse whites))
    1.51 -               mask (presets key)]
    1.52 +               mask (color-channel-presets key)]
    1.53             (fn [world]
    1.54               (register-eye! world)
    1.55               (vector