 (def PIX-CNT1 (* WIDTH HEIGHT 4))
 (def PIX-CNT2 (* WIDTH HEIGHT))
 
+(def BW-THRESH 200) ; between 0-255 (gray -> BW cut-off)
 (def this (atom nil))
 
 ;; bArray is the temporary byte array buffer for OpenCV cv::Mat.
 ;; iArray is the temporary integer array buffer for PImage pixels.
 (defn setup []
-  (reset! this videotest)
   (q/frame-rate 60)
   {:b-array (byte-array PIX-CNT1)
    :i-array (int-array PIX-CNT2)

  :on-close on-close
  :middleware [m/fun-mode])


             40 40))

(defn draw-centroids [{:keys [detector]}]
  (when (and detector
             (< 0 (.getBlobsNumber detector)))
    (q/push-style)
    (q/no-stroke)
    (q/fill 0 255 0 80)
    (dorun
     (map #(draw-centroid detector %)
          (range 0 (.getBlobsNumber detector))))
    (q/pop-style)))

(defn draw [state]
  (let [{:keys [p-image]} state]
