         tri-glyphs (triangle-glyphs tri-pts tri-orients)]
    {:b-array (byte-array PIX-CNT1)
     :i-array (int-array PIX-CNT2)
-    :frame-mat (Mat. HEIGHT WIDTH CvType/CV_8UC3)
-    :output-mat (Mat. HEIGHT WIDTH CvType/CV_8UC4)
-    :gray-mat (Mat.)
-    :rgba-mat (Mat.)
-    :drawn-mat (Mat. HEIGHT WIDTH CvType/CV_8UC4)
+    :frame-mat (mat CAM-HEIGHT CAM-WIDTH CvType/CV_8UC3)
+    :output-mat (mat DISPLAY-HEIGHT DISPLAY-WIDTH CvType/CV_8UC4)
+    :gray-mat (mat)
+    :rgba-mat (mat CAM-HEIGHT CAM-WIDTH CvType/CV_8UC4)
+    :drawn-mat (mat DISPLAY-HEIGHT DISPLAY-WIDTH CvType/CV_8UC4)
     :camera (cv/camera CAM-DEV-NUM)
-    :p-image (q/create-image WIDTH HEIGHT :rgb)
+    :p-image (q/create-image DISPLAY-WIDTH DISPLAY-HEIGHT :rgb)
     :triangle-points tri-pts
     :triangle-orientations tri-orients
     :triangle-glyphs tri-glyphs}))

  (let [{:keys [p-image frame-mat]} state]
    (q/background 0)
    (q/push-matrix)
    (q/translate WIDTH 0)
    (q/scale -1 1)
    (when p-image
      (q/image p-image 0 0)
      #_(draw-centroids state))
    #_(when-not (cv/mat-empty? frame-mat)
      (draw-mosaic state))
    (q/pop-matrix)))

(defn on-close


(q/defsketch videotest
  :title "Video Test"
  :size [DISPLAY-WIDTH DISPLAY-HEIGHT]
  :setup setup
  :update update
  :draw draw
  :on-close on-close
  :middleware [m/fun-mode])

;; (.setResizable (.frame videotest) true)
