https://github.com/boechat107/imgpviewer
An image processing library fully written in Clojure
https://github.com/boechat107/imgpviewer
Last synced: 2 months ago
JSON representation
An image processing library fully written in Clojure
- Host: GitHub
- URL: https://github.com/boechat107/imgpviewer
- Owner: boechat107
- Created: 2012-05-02T18:54:08.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-07-08T14:43:47.000Z (almost 12 years ago)
- Last Synced: 2025-01-21T13:25:48.555Z (4 months ago)
- Language: Clojure
- Homepage:
- Size: 7.5 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# image-processing
This is a library for raw image processing in Clojure.
## Some features
* Loads images using the ImageIO Java library.
* Image visualization.
* Basic transformations:
- change color space
- erode
- binarization## Some implementation details
The basic data structure used in this library is defined as record called `Image`, whose fields are `:mat` and `:type`. The value of `:mat` is always assumed to be a vector of vectors, like a matrix, that represents each pixel of an image. If an `Image` object has `:type` value equals to `:rgb` (the default color space), each pixel is represented by vector `[r g b]`. If `:type` is `:gray` (grayscale), each pixel is represented just by a number, the intensity of the pixel (usually in the interval `[0, 255]`).
## Basic usage
```clj
(ns image-processing.test.processing
(:require
[image-processing.core-new :as ipc]
[image-processing.processing :as pr]
[image-processing.helpers :as ih]))(let [img (ih/load-file-image "test/test.jpg"),
gray (pr/rgb-to-gray img),
bw (pr/binarize gray 100),
er (pr/erode bw)]
(ih/view img gray bw er))
```## Installation
Add to the dependencies of a leiningen project:
```clj
[org.clojars.boechat107/image-processing "2.0.0-SNAPSHOT"]
```