     (q/scale -1 1)
     (when p-image
       (q/image p-image 0 0)
-      #_(draw-centroids state))
+      (draw-centroids state))
     (q/pop-matrix)))
 
 (defn on-close

    (update-in state [:p-image] #(cv/gray-mat->p-img gray-mat output-mat b-array i-array %))
    state))

(defn update-blobs [{:keys [detector p-image] :as state}]
  (when p-image
    (.imageFindBlobs detector p-image)
    (.loadBlobsFeatures detector)
    (.findCentroids detector))
  state)

(defn update [state]

   [quil.middleware :as m]
   [videotest.cv-blob.cv :as cv])
  (:import
   [org.opencv.core CvType Mat MatOfKeyPoint Point Size]
   [org.opencv.features2d FeatureDetector KeyPoint]
   [org.opencv.imgproc Imgproc]
   [java.nio ByteBuffer ByteOrder]))


(def CAM-SIZE (cv/camera-frame-size))
(def WIDTH  (int (:width  CAM-SIZE)))
