   (s/and ::ndarray ::all-bytes ::rgb-array))
 
 (defn to-image
-  "Convert a NDArray image in RGB format to a real image"
+  "Convert a NDArray image in RGB format to a real image.
+   `input`: `NDArray` - Source image in NDArray
+   returns: `BufferedImage`"
   [input]
   (util/validate! ::to-image-ndarray input "Invalid input array")
   (Image/toImage input))

   (apply-border input top bottom left right {})))

(defn fixed-crop
  "Return a fixed crop of the image"
  [input x0 y0 w h]
  (util/validate! ::ndarray input "Invalid input array")
  (util/validate! ::int x0 "Invalid starting x coordinate")

  (s/or :none nil? :some ::to-rgb))

(defn read-image
  "Reads an image file and returns an ndarray with OpenCV. It returns image in
   RGB by default instead of OpenCV's default BGR.
    `filename`: string - Name of the image file to be loaded
    `color-flag`: 0 or 1 - Convert decoded image to grayscale (0) or color (1)
    `to-rgb`: boolean - Whether to convert decoded image to mxnet's default RGB
            format (instead of opencv's default BGR)
    `output`: nil or `NDArray`
    returns: `NDArray` with dtype uint8

   Ex:
     (read-image \"cat.jpg\")
     (read-image \"cat.jpg\" {:color-flag 0})
     (read-image \"cat.jpg\" {:color-flag 1 :output nd})"
  ([filename {:keys [color-flag to-rgb output]
              :or {color-flag nil to-rgb nil output nil}
              :as opts}]
