Classes | |
| class | Color |
| IDIL color class. More... | |
Reorder elements | |
| template<typename T> | |
| Array< T > & | transpose (Array< T > &im) |
| Transpose a matrix or an image. | |
Colors | |
| Color & | gray (char g) |
| Returns a gray color. | |
| Color & | color (char r, char g, char b) |
| Returns the color (r,g,b). | |
| #define | black color(0,0,0) |
| Returns a black color. | |
| #define | white color(255,255,255) |
| Returns a white color. | |
| #define | blue color(0,0,255) |
| Returns a blue color. | |
| #define | green color(0,255,0) |
| Returns a green color. | |
| #define | red color(255,0,0) |
| Returns a red color. | |
| #define | yellow color(255,255,0) |
| Returns yellow color. | |
| #define | orange color(255,128,64) |
| Returns orange color. | |
| #define | pink color(255,0,255) |
| Returns pink color. | |
| #define | purple color(192,0,128) |
| Returns purple color. | |
| #define | brown color(128,96,0) |
| Returns brown color. | |
Accessing Image info | |
| template<typename T> | |
| long | XSize (Array< T > &im) |
| Return the horizontal dimension of the image. | |
Image I/O | |
| template<typename T> | |
| *Array< T > & | loadImage (Array< T > &im, string str) |
| Load an image and returns it. | |
| *Array< unsigned char > & | loadImage (string str) |
| Load an (unsigned char) image from a file. | |
| template<typename T> | |
| *void | saveImage (string str, Array< T > &im) |
| Save an image. | |
| template<typename T, typename T2> | |
| *void | saveDrishtiRAW (string str, Array< T2 > &im) |
| Save an 3D volume unsing the Drishti file format. | |
| template<typename T> | |
| *Array< T > & | readDrishtiRAW (string str) |
| Read a 3D volume unsing the Drishti file format. | |
| template<class T> | |
| char | getDrishtiType () |
| template<> | |
| char | getDrishtiType< unsigned char > () |
| template<> | |
| char | getDrishtiType< unsigned short > () |
| template<> | |
| char | getDrishtiType< unsigned int > () |
| template<> | |
| char | getDrishtiType< float > () |
| void | saveDrishtiPolyline (string str, Array< int > &gridsize, Array< float > &x, Array< float > &y, Array< float > &z, Array< float > &r) |
Extraction | |
| template<typename T> | |
| Array< T > & | extractLine (Array< T > &im, int x1, int y1, int x2, int y2) |
| Extract a linear segment from a 2D picture. | |
| template<typename T> | |
| Array< T > & | channel (Array< T > &im, int ch) |
| Extract a color channel from a picture. | |
| template<typename T> | |
| Array< T > & | color (Array< T > &im) |
| Make a color from a grey level image. | |
| template<typename T> | |
| Array< T > & | color (Array< T > &im, Array< Color > &map, bool saturate=true) |
| Make a color from a grey level image and a color map. | |
| template<typename T> | |
| Array< T > & | color (Array< T > &imr, Array< T > &img, Array< T > &imb) |
| Make a color from 3 grey level images, one par channel. | |
| template<class T> | |
| Array< double > & | dist (Array< T > &t) |
| Returns an array containing the distance to the closest corner (2D only). | |
| template<typename T> | |
| Array< T > & | crop (Array< T > &im, long xmin, long xmax, long ymin, long ymax, long zmin=0, long zmax=0) |
| Crop a 2D/3D image. | |
| template<typename T> | |
| Array< T > & | resize (Array< T > &im, int sx, int sy, int sz=-100, int interp=1) |
| Resize the image with a Deriche filter (quasi-gaussian filter, from CImg). | |
Image Operations | |
| template<class T> | |
| Array< T > & | normalise (Array< T > &t, T tmax=255) |
| Normalise an Array. | |
| template<class T, class T2> | |
| Array< T > & | threshold (Array< T > &t, T2 th, T2 ton=1, T2 toff=0) |
| Threshold an Array. | |
| template<typename T> | |
| Array< T > & | rotate (Array< T > &im, float angle, int cond=2) |
| Rotate in the 2D plane the image with a Deriche filter (quasi-gaussian filter, calling CImg). | |
| template<typename T> | |
| Array< T > & | blur (Array< T > &im, float sigma) |
| Blur the image with a Deriche filter (quasi-gaussian filter, CImg). | |
| template<typename T> | |
| Array< T > & | deriche (Array< T > &im, float sigma, const int order=0, const char axe= 'x', const unsigned int cond=1) |
| Apply the deriche filter the image with a Deriche filter (from CImg). | |
| template<typename T> | |
| Array< T > & | erode (Array< T > &im, int n=1) |
| Erode the image (CImg). | |
| template<typename T> | |
| Array< T > & | dilate (Array< T > &im, int n=1) |
| Dilate the image. | |
| template<typename T> | |
| Array< T > & | thin (Array< T > &im) |
| Thin the image (works only in 2D). | |
| template<typename T> | |
| Array< T > & | skeletonize (Array< T > &im) |
| Skeletonize the image (2D). | |
| template<typename T> | |
| Array< int > & | label (Array< T > &im, bool includediag=false) |
| Label the domains of a binarized image (2D & 3D). | |
| template<typename T> | |
| Array< int > & | voronoi (Array< T > &im) |
| Computes the Voronoi tesselation of an image (2D & 3D). | |
| template<typename T> | |
| Array< T > & | distanceMap (Array< T > &im, int mode=0) |
| Computes the distance map of an image (2D & 3D). | |
| template<typename T> | |
| Array< complex< double > > & | simple_fft (Array< complex< T > > &ct, const bool inverse=false) |
| FFT for images. | |
| template<typename T> | |
| Array< complex< double > > & | simple_fft (Array< T > &t, const bool inverse=false) |
| FFT for images. | |
| template<typename T> | |
| Array< T > & | radon (Array< T > &t, long theta_res=180, long rho_res=200) |
| Compute the radon transform of the image (2D Mono only). | |
| template<typename T> | |
| Array< T > & | gradon (Array< T > &t, long theta_res=180, long rho_res=200) |
| Computes the histogram of the gradient orientations (2D mono). | |
Image Drawing | |
| template<typename T> | |
| void | fill (Array< T > &im, const Color &clr) |
| template<class T> | |
| void | drawLine (Array< T > &im, long x1, long y1, long x2, long y2, Color &c, unsigned int pattern=-1, float opacity=1) |
| Draw a line on a picture, from the coordinates (x1,y1) to (x2,y2), with color c. | |
| template<class T> | |
| void | drawRectangle (Array< T > &im, long x1, long y1, long x2, long y2, Color &c, float opacity=1) |
| Draw a rectangle on a picture, from the coordinates (x1,y1) to (x2,y2), with color c. | |
| template<class T> | |
| void | drawBox (Array< T > &im, long x1, long y1, long x2, long y2, Color &c, unsigned int pattern=-1, float opacity=1) |
| Draw a box on a picture, from the coordinates (x1,y1) to (x2,y2), with color c. | |
| template<class T> | |
| void | drawTriangle (Array< T > &im, long x0, long y0, long x1, long y1, long x2, long y2, Color &c, unsigned int pattern=-1, float opacity=1) |
| Draw a box on a picture, from the coordinates (x1,y1) to (x2,y2), with color c. | |
| template<class T> | |
| void | drawCircle (Array< T > &im, long x0, long y0, float r, Color &c, unsigned int pattern=-1, float opacity=1) |
| Draw a circle on a picture, from the coordinates (x1,y1) to (x2,y2), with color c. | |
| template<class T, class T2> | |
| void | drawImage (Array< T > &im, long x, long y, Array< T2 > &sprite) |
| Draw a 2D sprite on a 2D image, at the coordinates (x,y). | |
| template<class T> | |
| void | drawPoint (Array< T > &im, long x, long y, T r=0, T g=0, T b=0) |
| Draw a point on a picture, at the coordinates (x,y), with color (r,g,b). | |
| template<class T> | |
| void | drawPoint (Array< T > &im, long x, long y, Color c) |
| Draw a point on a picture, at the coordinates (x,y), with color c. | |
| template<class T> | |
| void | drawPoint (Array< T > &im, long x, long y, long z, Color c) |
| Draw a point on a picture, at the coordinates (x,y), with color c. | |
| template<class T> | |
| CImg< T > & | getCImgReference (Array< T > &im) |
| template<class T> | |
| void | releaseCImgReference (CImg< T > &cimgref) |
IDIL contains many routines for Image manipulation, from IO operations to image analysis tools. IDIL makes use when possible of the CImg library, and uses a similar way to represent images in the memory.
An image is basically an Array of any type T with the following convention for its dimension:
Array<T> [X_Size, Y_Size, Z_Size, Pixel_colors, Time]
The Image has 5 dimensions allowing for both Z-Stacks and time dependance. If the Z dimension is used, 3D algorithms will be applied when available. Algorithms are also applied sequentially for each color and time, unless specified otherwise.
Blur the image with a Deriche filter (quasi-gaussian filter, CImg).
| im | : image Array, | |
| sigma | : width. |
Extract a color channel from a picture.
| im | : image, | |
| ch | : channel (0: red, 1: blue, 2:green). |
| Array<T>& color | ( | Array< T > & | imr, | |
| Array< T > & | img, | |||
| Array< T > & | imb | |||
| ) | [inline] |
Make a color from 3 grey level images, one par channel.
| imr | : red channel image. | |
| img | : green channel image. | |
| imb | : blue channel image. |
| Array<T>& color | ( | Array< T > & | im, | |
| Array< Color > & | map, | |||
| bool | saturate = true | |||
| ) | [inline] |
Make a color from a grey level image and a color map.
| im | : image, | |
| im | : color map, as an array of colors. |
Make a color from a grey level image.
| im | : image. |
| Array<T>& crop | ( | Array< T > & | im, | |
| long | xmin, | |||
| long | xmax, | |||
| long | ymin, | |||
| long | ymax, | |||
| long | zmin = 0, |
|||
| long | zmax = 0 | |||
| ) | [inline] |
Crop a 2D/3D image.
| im | : image Array, | |
| xmin,xmax,ymin,ymax,zmin,zmax. | Returns the croped image. |
throw !!!
| Array<T>& deriche | ( | Array< T > & | im, | |
| float | sigma, | |||
| const int | order = 0, |
|||
| const char | axe = 'x', |
|||
| const unsigned int | cond = 1 | |||
| ) | [inline] |
Apply the deriche filter the image with a Deriche filter (from CImg).
Returns the filtered image.
Dilate the image.
| im | : image Array, | |
| n | : number of dilatations. |
Computes the distance map of an image (2D & 3D).
| im | : image Array, | |
| mode | : distance measurement: 0 = Manhatan, 1 = Chessboard The input image is first thresholded to force values to be 0 or 1. Boundaries are assumed to be 0 in the current version. |
| void drawBox | ( | Array< T > & | im, | |
| long | x1, | |||
| long | y1, | |||
| long | x2, | |||
| long | y2, | |||
| Color & | c, | |||
| unsigned int | pattern = -1, |
|||
| float | opacity = 1 | |||
| ) | [inline] |
Draw a box on a picture, from the coordinates (x1,y1) to (x2,y2), with color c.
| im | : image Array, | |
| x1,y1 | : starting point, | |
| x2,y2 | : end point, | |
| c | : color used for the line. | |
| pattern | : see CImg. | |
| opacity | : opacite [0-1]. |
| void drawCircle | ( | Array< T > & | im, | |
| long | x0, | |||
| long | y0, | |||
| float | r, | |||
| Color & | c, | |||
| unsigned int | pattern = -1, |
|||
| float | opacity = 1 | |||
| ) | [inline] |
Draw a circle on a picture, from the coordinates (x1,y1) to (x2,y2), with color c.
| im | : image Array, | |
| x1,y1 | : coordinates of the circle center | |
| r | : radius of the circle | |
| c | : color used for the line. | |
| pattern | : see CImg. | |
| opacity | : opacite [0-1]. |
| void drawImage | ( | Array< T > & | im, | |
| long | x, | |||
| long | y, | |||
| Array< T2 > & | sprite | |||
| ) | [inline] |
Draw a 2D sprite on a 2D image, at the coordinates (x,y).
| im | : image Array, | |
| x,y | : top-left corner coordinates, | |
| sprite | : image to insert. |
| void drawLine | ( | Array< T > & | im, | |
| long | x1, | |||
| long | y1, | |||
| long | x2, | |||
| long | y2, | |||
| Color & | c, | |||
| unsigned int | pattern = -1, |
|||
| float | opacity = 1 | |||
| ) | [inline] |
Draw a line on a picture, from the coordinates (x1,y1) to (x2,y2), with color c.
| im | : image Array, | |
| x1,y1 | : starting point, | |
| x2,y2 | : end point, | |
| c | : color used for the line. | |
| pattern | : see CImg. | |
| opacity | : opacite [0-1]. |
| void drawRectangle | ( | Array< T > & | im, | |
| long | x1, | |||
| long | y1, | |||
| long | x2, | |||
| long | y2, | |||
| Color & | c, | |||
| float | opacity = 1 | |||
| ) | [inline] |
Draw a rectangle on a picture, from the coordinates (x1,y1) to (x2,y2), with color c.
| im | : image Array, | |
| x1,y1 | : starting point, | |
| x2,y2 | : end point, | |
| c | : color used for the line. | |
| opacity | : opacite [0-1]. |
| void drawTriangle | ( | Array< T > & | im, | |
| long | x0, | |||
| long | y0, | |||
| long | x1, | |||
| long | y1, | |||
| long | x2, | |||
| long | y2, | |||
| Color & | c, | |||
| unsigned int | pattern = -1, |
|||
| float | opacity = 1 | |||
| ) | [inline] |
Draw a box on a picture, from the coordinates (x1,y1) to (x2,y2), with color c.
| im | : image Array, | |
| x1,y1 | : starting point, | |
| x2,y2 | : end point, | |
| c | : color used for the line. | |
| pattern | : see CImg. | |
| opacity | : opacite [0-1]. |
Erode the image (CImg).
| im | : image Array, | |
| n | : number of erosions. |
| Array<T>& extractLine | ( | Array< T > & | im, | |
| int | x1, | |||
| int | y1, | |||
| int | x2, | |||
| int | y2 | |||
| ) | [inline] |
Extract a linear segment from a 2D picture.
| im | : image, | |
| x1,y1 | : start point, | |
| x2,y2 | : end point. |
| Array<T>& gradon | ( | Array< T > & | t, | |
| long | theta_res = 180, |
|||
| long | rho_res = 200 | |||
| ) | [inline] |
Computes the histogram of the gradient orientations (2D mono).
| t | : image Array, | |
| theta_res | : resolution of the angular axis, | |
| rho_res | : resolution in the radial direction |
Label the domains of a binarized image (2D & 3D).
| im | : image Array, |
| * Array<unsigned char>& loadImage | ( | string | str | ) |
Load an (unsigned char) image from a file.
| str | : filename. |
| Array<T>& radon | ( | Array< T > & | t, | |
| long | theta_res = 180, |
|||
| long | rho_res = 200 | |||
| ) | [inline] |
Compute the radon transform of the image (2D Mono only).
| t | : image Array, | |
| theta_res | : resolution of the angular axis, | |
| rho_res | : resolution in the radial direction |
| * Array<T>& readDrishtiRAW | ( | string | str | ) | [inline] |
| Array<T>& resize | ( | Array< T > & | im, | |
| int | sx, | |||
| int | sy, | |||
| int | sz = -100, |
|||
| int | interp = 1 | |||
| ) | [inline] |
Resize the image with a Deriche filter (quasi-gaussian filter, from CImg).
| im | : image Array, | |
| sx,sy | : new size, pourcent if negative. | |
| interp | : interpolation mode |
Returns the resized image.
Rotate in the 2D plane the image with a Deriche filter (quasi-gaussian filter, calling CImg).
| im | : image Array, | |
| angle | : angle. |
| * void saveDrishtiRAW | ( | string | str, | |
| Array< T2 > & | im | |||
| ) | [inline] |
| * void saveImage | ( | string | str, | |
| Array< T > & | im | |||
| ) | [inline] |
| Array<complex<double> >& simple_fft | ( | Array< T > & | t, | |
| const bool | inverse = false | |||
| ) | [inline] |
FFT for images.
| t | : image Array with a real valued type, | |
| inverse | : false for direct, true for inverse. |
Computes the Voronoi tesselation of an image (2D & 3D).
| im | : image Array, |
1.5.5