   (Image/fixedCrop input x0 y0 w h))
 
 (defn rgb-array?
-  "Returns whether the ndarray is in the RGB format"
+  "Returns whether the ndarray is in the RGB format
+   `input`: `NDArray` - Source image in NDArray
+   returns: boolean"
   [input]
   (util/validate! ::ndarray input "Invalid input array")
   (let [shape (ndarray/shape-vec input)]

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

(defn read-image
  "Reads an image file and returns an ndarray"
  ([filename {:keys [color-flag to-rgb output]
              :or {color-flag nil to-rgb nil output nil}
              :as opts}]

  (s/keys :opt-un [::color-flag ::to-rgb ::output]))

(defn decode-image
  "Decodes an image from an input stream with OpenCV
    `input-stream`: `InputStream` - Contains the binary encoded image
    `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:
    (decode-image input-stream)
    (decode-image input-stream {:color-flag 1})
    (decode-image input-stream {:color-flag 0 :output nd})"
  ([input-stream {:keys [color-flag to-rgb output]
                  :or {color-flag COLOR to-rgb true output nil}
                  :as opts}]
