Liking cljdoc? Tell your friends :D

think.image.patch


*content-threshold-cutoff*clj

source

buffered-image-has-alpha-channel?clj

(buffered-image-has-alpha-channel? img)

Return true of this image has alpha channel

Return true of this image has alpha channel
sourceraw docstring

content-rect->gray-imageclj

(content-rect->gray-image src-img content-rect)

Without a specific method to get a precise content mask we can create one from the content rect returned from image->content-rect.

Without a specific method to get a precise content mask we can create one from the
content rect returned from image->content-rect.
sourceraw docstring

double-to-longclj

(double-to-long item)
source

generate-n-filtered-rectsclj

(generate-n-filtered-rects rect-filter-fn
                           content-rect
                           rect-count
                           rect-dim
                           &
                           {:keys [max-src-rect-count]
                            :or {max-src-rect-count 500}})

Generate max-src-rect-count random sub-rects, filter by a given filter function. Return rect-count of those.

Generate max-src-rect-count random sub-rects, filter by a given
filter function.  Return rect-count of those.
sourceraw docstring

image->content-rectclj

(image->content-rect img)
source

image->edge-content-maskclj

(image->edge-content-mask img)
source

image->patchclj

(image->patch img
              &
              {:keys [rect datatype colorspace data-array normalize]
               :or {datatype :double colorspace :rgb normalize true}})

By default, turns BufferedImage img into an array suitable for cortex input. If :normalize set to false, returns RGB array of pixel values.

By default, turns BufferedImage img into an array suitable for cortex input.
If :normalize set to false, returns RGB array of pixel values.
sourceraw docstring

image->patch-implcljmacro

(image->patch-impl data-array num-pixels cast-fn array-fn normalize?)
source

image->patchesclj

(image->patches img
                patches-per-image
                patch-dim
                datatype
                &
                {:keys [image-augmentation-fn]})

If an image has an alpha channel, then we assume it has a mask. Else we assume it is safe to create patches out of the entire image.

If an image has an alpha channel, then we assume it has a mask.  Else we assume
it is safe to create patches out of the entire image.
sourceraw docstring

image-src->patchesclj

(image-src->patches img-src
                    patches-per-image
                    patch-dim
                    datatype
                    &
                    {:keys [image-augmentation-fn]})

Given a filename produce a set of random rgb patches of a given datatype potentially augmented.

Given a filename produce a set of random rgb patches of a given datatype potentially
augmented.
sourceraw docstring

is-rect-completely-within-mask?clj

(is-rect-completely-within-mask? mask-img rect)
(is-rect-completely-within-mask? mask-img rect byte-data)

Is this rect contained by the mask

Is this rect contained by the mask
sourceraw docstring

masked-image->patchesclj

(masked-image->patches img
                       mask-img
                       patch-count
                       patch-dim
                       content-rect
                       datatype
                       &
                       {:keys [image-augmentation-fn]})
source

patch->imageclj

(patch->image data img-width)
source

patch-mean-subtractclj

(patch-mean-subtract patch r-mean g-mean b-mean & {:keys [bgr-reorder]})

Subtracts means of global images from each channel and optionally reorders RGB->BGR. Use for ResNet image preprocessing.

Subtracts means of global images from each channel and optionally reorders RGB->BGR.
Use for ResNet image preprocessing.
sourceraw docstring

pixel-byte->doubleclj

(pixel-byte->double byte-item)
source

random-sub-rectclj

(random-sub-rect outer-rect output-dim)

Create a square sub-rect inside the outer-rect

Create a square sub-rect inside the outer-rect
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close