 (defn clone [mat]
   (.clone mat))
 
+(defn inverse [mat]
+  (.inv mat))
+
+(defn identity-mat [rows cols type]
+  (Mat/eye rows cols type))
+  
 (defn size
   [img]
   (.size img))

    (if (< x 0)
      base-atom
       (let [m (matrix-multiplication h (.t (.row base-points x)))]
        (if (> (first (.get m 0 0)) (:max_x @base-atom))
          (swap! base-atom  merge {:max_x (first (.get m 0 0))}))
        (if (> (first (.get m 1 0)) (:max_y @base-atom))
          (swap! base-atom  merge {:max_y (first (.get m 1 0))}))
        (if (< (first (.get m 0 0)) (:min_x @base-atom))
          (swap! base-atom  merge {:min_x (first (.get m 0 0))}))
        (if (< (first (.get m 1 0)) (:min_y @base-atom))
          (swap! base-atom  merge {:min_y (first (.get m 1 0))}))
            (recur (dec x) ))))
    @base-atom))

(defn stitch [img-a img-b]
  (let [res (Mat.)

  (def row (.rows keyImage))

  (def keyImage (first rsiv))
  (def h (calculate-homography (second rsiv) (first rsiv)))
  (def inv-h (.inv h))
  (find-dimensions inv-h keyImage)



