eye-boof.core

as-seq

(as-seq img)
Returns the image's data as a Clojure sequence.

band!

(band! pimg n)
Returns a GrayU8 image as a color channel of a Planar image. IMPORTANT:
modifying the returned image has the side effect of modifying the given
image.

entropy-threshold

(entropy-threshold img min-val max-val)
GrayU8 -> int -> int -> int
Computes a threshold which maximizes the entropy between the foreground and
background regions.

height

(height img)
Returns the image's height.

load-image->gray-u8

(load-image->gray-u8 resource)
Returns a BoofCV GrayU8 image from a given resource, which can be a String
(file path), File, InputStream or URL. If the resource represents a color
image, the intensities of each channel are averaged together.

load-image->planar-u8

(load-image->planar-u8 resource)
Returns a BoofCV Planar<GrayU8> image from a given resource, which can be a
String (file path), File, InputStream or URL.

local-sauvola-threshold

(local-sauvola-threshold img radius down1? & [k])
GrayU8 -> int -> boolean -> GrayU8
Applies Sauvola thresholding algorithm to the input image. k is a tuning
parameter whose default value is 0.3.
Refs.: https://goo.gl/hhyGyc, https://goo.gl/1iRba2

local-square-threshold

(local-square-threshold img radius down1? & [scale])
GrayU8 -> int -> boolean -> GrayU8
Locally adaptive threshold computed using a square region centered on each
pixel. The threshold value is equal the average intensity of the square region
times the optional scale (default to 1.0).
Ref.: https://goo.gl/nQn90i

num-of-bands

(num-of-bands pimg)
Returns the number of color channels of a Planar image.

otsu-threshold

(otsu-threshold img min-val max-val)
GrayU8 -> int -> int -> int
Computes the variance based threshold using the Otsu's method.

resource->buff-image

(resource->buff-image r)
Returns a BufferedImage from a given resource.

save-image!

(save-image! img filepath)
Saves the given image representation.

threshold

(threshold img n down1?)
Global threshold. If down1? is true, pixel values <= n are set to 1.

threshold-f

(threshold-f img f down1?)
GrayU8 -> (GrayU8 -> int) -> boolean -> GrayU8
Global threshold with the value calculated from f(img). If down1? is true,
pixel values <= f(img) are set to 1.

width

(width img)
Returns the image's width.