           _ (Imgproc/drawContours mask card-contours -1 (Scalar. 0 0 0) -1)
           outside-color (Core/mean target mask)
           [outside-h outside-s outside-l] (scalar-to-hsl outside-color)
-          fill (cond (and (close-enough inside-l edge-l 5)
-                          (close-enough inside-h edge-h 5))
+          fill (cond (and (close-enough? inside-l edge-l 5)
+                          (close-enough? inside-h edge-h 5))
                      :filled
-                     (and (close-enough inside-l outside-l 5)
-                          (close-enough inside-h outside-h 30)
-                          (close-enough inside-s outside-s 5)) :empty
+                     (and (close-enough? inside-l outside-l 5)
+                          (close-enough? inside-h outside-h 30)
+                          (close-enough? inside-s outside-s 5)) :empty
                           :else :shaded)
 
           _ (let [m (-> (Core/mean target-gray) .val first (* 0.80))]

    (->> contours
         (filter #(< 250 (Imgproc/contourArea %)))
         (filter #(> 0.5 (match-shapes-i1 card-shape (contour-hu-invariants %))))
         (filter is-rectangle)
         ;; eliminate overlapping contours
         (reduce (fn [cs c]
                   (if (some #(rect-close-enough? (Imgproc/boundingRect %) (Imgproc/boundingRect c)) cs)

       :shape sname
       :color cname
       :fill fill
       :contour contour
       :bb br
       :image target})))

