This page is maintained in the package's github repository.
This is a Chicken Scheme egg with various image processing utilities.
Note that a few of these functions call ImageMagick.
Color spaces
- *max-red*
- *max-green*
- *max-blue*
- *max-grey*
- *max-hue*
- *max-saturation*
- *max-value*
- (rgb->hsv rgb)
- (hsv->rgb hsv)
- (rgb->cd rgb)
- (rgb->cmyk rgb)
- (rgb->uv-hsv c)
- (rgb->xyz c)
- (xyz->rgb c)
- (xyz->l*ab c)
- (l*ab->xyz c)
- (rgb->l*ab c)
- (l*ab->rgb c)
- (rgb->html c)
Images
- (define-structure pbm raw? bitmap)
- (define-structure pgm raw? maxval grey)
- (define-structure ppm raw? maxval red green blue)
- (pnm? m)
- (image-ref i p)
- (pbm-ascii pbm)
- (pnm-copy pnm)
Creating images
- (read-pnm pathname)
- (write-pnm pnm pathname)
- (pbm-constant width height bit)
- (pgm-constant width height grey)
- (ppm-constant width height red green blue)
- (pbm-left-vertical-stripe width height left)
- (crop-image pnm x y width height)
- (pnm->ppm pnm)
- (pnm->pgm pnm)
- (pbm->pgm pbm)
- (pgm->ppm pgm)
- (pbm->ppm pbm)
- (ppm->pgm ppm)
- (pgm->pbm pgm threshold)
- (ppm->pbm ppm threshold)
Basic image information
- (pnm-width pnm)
- (pnm-height pnm)
- (ppm-hue ppm)
- (ppm-saturation ppm)
- (ppm-value ppm)
- (ppm-mean image colour-transform)
- (ppm-covariance image colour-transform)
- (pgm-mean image)
- (pgm-variance image)
Logical and morphological operations
- (pbm-and pbm1 pbm2)
- (pbm-or pbm1 pbm2)
- (pbm-not pbm)
- (pbm-xor pbm1 pbm2)
- (pgm-absolute-difference pgm1 pgm2)
- (empty-pnm? pnm)
- (pbm-skeletonize pbm)
- (pbm-bloat pbm n)
- (pbm-flood pbm point)
PNM movies
- (pnm-movie-frame-pathname pathname i)
- (pnm-movie-length pathname)
- (read-pnm-movie pathname)
- (write-pnm-movie pnm-movie pathname)
Image operations
- (overlay-pbm-on-pnm pbm pnm)
- (pnm-black-window pnm upper-left lower-right)
- (pnm-white-window pnm upper-left lower-right)
- (pbm-ppm-and pbm ppm)
- (pgm-and-pbm pgm pbm)
- (pnm-shift pnm delta)
- (pgm-smooth pgm sigma)
- (pbm-proximity-clusterer pbm threshold)
- (pnm-rotate pnm)
- (pnm-flip pnm)
- (ppm-burn base mask colour)
Image pairs
- (normal-flow-magnitude pgm1 pgm2 epsilon sigma sensitivity)
- (threshold-normal-flow-magnitude pgm1 pgm2 epsilon sigma threshold)
Thresholding
- (flatten-ppm ppm colour-transform)
- (binary-threshold pgm threshold)
- (find-threshold-otsu pgm)
- (binary-threshold-optimal pgm)
- (find-threshold-means pgm)
- (binary-threshold-means pgm)
Colour Threshold
- (sample-image ppm colour-tx window-centre window-size)
- (binary-threshold-colour ppm colour-tx point threshold)
- (colour-threshold ppm colour-tx mu isigma threshold)
Histogram Equalization
- (histogram-equalise pgm)
Adaptive Thresholding
- (make-integral-matrix matrix)
- (compute-integral-matrix-mu integral-matrix x y w)
- (compute-integral-matrix-sigma squared-integral-matrix mu x y w)
- (compute-adaptive-threshold integral-matrix squared-integral-matrix x y w)
- (adaptive-threshold pgm winsize)
- (slide-window m f size)
- (count-pixels a)
- (ppm->label-closest ppm mu1 sigma1 mu2 sigma2 #!optional colour-transform)
Histogram
- (find-histogram pixmap maxval)
- (histogram-mean histogram i)
- (histogram-variance histogram mu i)
- (normalised-histogram histogram val)
- (weighted-histogram histogram)
- (cumulative-histogram histogram)
- (find-between-class-variances omegas mus mu-total)
Rendering Line Segments
- (midpoint l)
- (orientation v)
- (line-segment-orientation l)
- (line-segment->points l)
- (line-segments->points ls)
- (points->line-segments ps)
Points and bounding boxes
- (points->pbm-of-size points height width)
- (points-bounding-box points)
- (bounding-box-size bb)
- (points->points-bounding-box points bb)
- (points->bounding-box-points points)
- (normalize-to-bounding-box ps)
- (normalize-to-other-bounding-box points ps)
- (points->target-bounding-box points target-bb)
- (points->other-target-bounding-box points ps target-bb)
- (bounding-box-bloat bb p)
- (bounding-box-crop bb image)
- (pbm->points pbm)
- (points->pbm points height width)
Quantization
- (quantize-coordinate x)
- (quantize-point p)
- (quantize-points ps)
- (quantize-line-segment l)
- (quantize-line-segments ls)
Ellipses
- (define-structure ellipse x0 y0 t0 a b)
- (ellipse-center ellipse)
- (ellipse-area ellipse)
- (ellipse-eccentricity ellipse)
- (radial-distance theta phi)
- (point-on-ellipse? p ellipse tolerance)
- (line-segment->ellipse l)
- (ellipse->points e #!optional (n 360))
Resizing
- (resize-image w h i)
- (subsample-pbm pbm)
- (scale-ppm ppm scale)
Connected Components
- (connected-component-filter pbm delta threshold)
- (define-private-structure vertex pixels vertex edges)
- (define-private-structure edge u v)
- (define-private-structure graph vertices edges)
- (pbm->graph pbm delta)
- (labeling->graph labeling delta)
- (dereference-vertex u)
- (connected-components g)
- (vertices->pbm vertices height width)
- (graph->pbm g height width)
Chains
- (pbm->chains pbm)
- (chains->pbm chains height width)
- (chain-filter pbm threshold)
- (break-chain chain l)
- (break-chains chains l)
Conjuring
- (conjure pbms delta span threshold1 threshold2)
Distance Transform
- (distance-transform pbm)
- (closest-transform-ref closest-transform p)
- (euclidean-1d-dt v)
- (euclidean-2d-dt m)
- (euclidean-1d-dt-vals v)
- (euclidean-2d-dt-vals m)
Buffers
- (define-structure pnm-buffer buffer width height pixfmt storage type)
- (pnm->pixfmt p p4?)
- (pixfmt->stride pixfmt)
- (image-type->pixfmt t p4?)
- (image-type->storage-size t p4?)
- (pnm->image-type p)
- (pnm->storage p)
- (pixfmt->red pixfmt)
- (pixfmt->green pixfmt)
- (pixfmt->blue pixfmt)
- (pnm-buffer-size p p4?)
- (pnm->pnm-buffer! p . p4?)
- (pnm-fill-buffer! p b pixfmt)
- (free-pnm-buffer! p)
- (imlib-image->pnm-buffer! image)
- (imlib-image->ppm image)
- (ppm->imlib-image ppm)
- (pnm-buffer->pnm b)
- (pnm-buffer->pbm p)
- (pnm-buffer->pgm p)
- (pnm-buffer->ppm p)
- (image->pnm-buffer! image)
Misc
- (ppm-absolute-difference ppm1 ppm2)
- (set-ppm-pixel! ppm x y value)
- (pnm-pixel? i x y)
- (map-ppm-values ppm f)
Stacking
- (pbm-stack-vertical pbm1 pbm2)
- (pbm-stack-horizontal pbm1 pbm2)
- (ppm-stack-vertical ppm1 ppm2)
- (ppm-stack-horizontal ppm1 ppm2)
Angles
- (degrees->radians angle)
- (radians->degrees angle)
- (normalize-rotation rotation)
- (rotation+ x y)
- (rotation- x y)
- (angle-separation x y)
- (mean-angle angles)
- (rotation-matrix-2d theta)
Display
- (show i)
License
Written by the [[Center for the Computational Study of Cognition, Control, and Perception|http://upplysingaoflun.ecn.purdue.edu/~qobi/cccp/]].
Maintainer: Andrei Barbu, andrei@0xab.com
Copyright 1993-1995 University of Toronto. All rights reserved. Copyright 1996 Technion. All rights reserved. Copyright 1996 and 1997 University of Vermont. All rights reserved. Copyright 1997-2001 NEC Research Institute, Inc. All rights reserved. Copyright 2002-2013 Purdue University. All rights reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses.