diff thesis/cortex.tex @ 425:efba8526a662

happy with code formatting.
author Robert McIntyre <rlm@mit.edu>
date Fri, 21 Mar 2014 02:48:23 -0400
parents 6b0f77df0e53
children 435b5e22d72a
line wrap: on
line diff
     1.1 --- a/thesis/cortex.tex	Fri Mar 21 01:52:50 2014 -0400
     1.2 +++ b/thesis/cortex.tex	Fri Mar 21 02:48:23 2014 -0400
     1.3 @@ -1,7 +1,97 @@
     1.4 -d
     1.5  
     1.6 +\section{Artificial Imagination}
     1.7 +\label{sec-1}
     1.8  
     1.9 -lol whatevar
    1.10 +Imagine watching a video of someone skateboarding. When you watch
    1.11 +the video, you can imagine yourself skateboarding, and your
    1.12 +knowledge of the human body and its dynamics guides your
    1.13 +interpretation of the scene. For example, even if the skateboarder
    1.14 +is partially occluded, you can infer the positions of his arms and
    1.15 +body from your own knowledge of how your body would be positioned if
    1.16 +you were skateboarding. If the skateboarder suffers an accident, you
    1.17 +wince in sympathy, imagining the pain your own body would experience
    1.18 +if it were in the same situation. This empathy with other people
    1.19 +guides our understanding of whatever they are doing because it is a
    1.20 +powerful constraint on what is probable and possible. In order to
    1.21 +make use of this powerful empathy constraint, I need a system that
    1.22 +can generate and make sense of sensory data from the many different
    1.23 +senses that humans possess. The two key proprieties of such a system
    1.24 +are \emph{embodiment} and \emph{imagination}.
    1.25  
    1.26 -\section{lol}
    1.27 -\label{sec-1}
    1.28 +\subsection{What is imagination?}
    1.29 +\label{sec-1-1}
    1.30 +
    1.31 +One kind of imagination is \emph{sympathetic} imagination: you imagine
    1.32 +yourself in the position of something/someone you are
    1.33 +observing. This type of imagination comes into play when you follow
    1.34 +along visually when watching someone perform actions, or when you
    1.35 +sympathetically grimace when someone hurts themselves. This type of
    1.36 +imagination uses the constraints you have learned about your own
    1.37 +body to highly constrain the possibilities in whatever you are
    1.38 +seeing. It uses all your senses to including your senses of touch,
    1.39 +proprioception, etc. Humans are flexible when it comes to "putting
    1.40 +themselves in another's shoes," and can sympathetically understand
    1.41 +not only other humans, but entities ranging from animals to cartoon
    1.42 +characters to \href{http://www.youtube.com/watch?v=0jz4HcwTQmU}{single dots} on a screen!
    1.43 +
    1.44 +
    1.45 +\begin{figure}[htb]
    1.46 +\centering
    1.47 +\includegraphics[width=5cm]{./images/cat-drinking.jpg}
    1.48 +\caption{A cat drinking some water. Identifying this action is beyond the state of the art for computers.}
    1.49 +\end{figure}
    1.50 +
    1.51 +
    1.52 +This is a basic test for the vision system.  It only tests the
    1.53 +vision-pipeline and does not deal with loading eyes from a blender
    1.54 +file. The code creates two videos of the same rotating cube from
    1.55 +different angles. 
    1.56 +
    1.57 +
    1.58 +\begin{clojurecode}
    1.59 +(in-ns 'cortex.test.vision)
    1.60 +
    1.61 +(defn test-pipeline
    1.62 +  "Testing vision:
    1.63 +   Tests the vision system by creating two views of the same rotating
    1.64 +   object from different angles and displaying both of those views in
    1.65 +   JFrames.
    1.66 +
    1.67 +   You should see a rotating cube, and two windows,
    1.68 +   each displaying a different view of the cube."
    1.69 +  ([] (test-pipeline false))
    1.70 +  ([record?]
    1.71 +     (let [candy
    1.72 +           (box 1 1 1 :physical? false :color ColorRGBA/Blue)]
    1.73 +       (world
    1.74 +        (doto (Node.)
    1.75 +          (.attachChild candy))
    1.76 +        {}
    1.77 +        (fn [world]
    1.78 +          (let [cam (.clone (.getCamera world))
    1.79 +                width (.getWidth cam)
    1.80 +                height (.getHeight cam)]
    1.81 +            (add-camera! world cam 
    1.82 +                         (comp
    1.83 +                          (view-image
    1.84 +                           (if record?
    1.85 +                             (File. "/home/r/proj/cortex/render/vision/1")))
    1.86 +                          BufferedImage!))
    1.87 +            (add-camera! world
    1.88 +                         (doto (.clone cam)
    1.89 +                           (.setLocation (Vector3f. -10 0 0))
    1.90 +                           (.lookAt Vector3f/ZERO Vector3f/UNIT_Y))
    1.91 +                         (comp
    1.92 +                          (view-image
    1.93 +                           (if record?
    1.94 +                             (File. "/home/r/proj/cortex/render/vision/2")))
    1.95 +                          BufferedImage!))
    1.96 +            (let [timer (IsoTimer. 60)]
    1.97 +              (.setTimer world timer)
    1.98 +              (display-dilated-time world timer))
    1.99 +            ;; This is here to restore the main view
   1.100 +            ;; after the other views have completed processing
   1.101 +            (add-camera! world (.getCamera world) no-op)))
   1.102 +        (fn [world tpf]
   1.103 +          (.rotate candy (* tpf 0.2) 0 0))))))
   1.104 +\end{clojurecode}