#include <ImageGrey.h>
Inheritance diagram for ImageGrey::

Public Methods | |
| ImageGrey (unsigned int width, unsigned int height) | |
| Create an image with the given dimensions. More... | |
| ImageGrey (char *, FileFormat) | |
| Create an image from a graphics file. More... | |
| ImageGrey (ImageGrey &) | |
| Copy constructor. More... | |
| ImageGrey (ImageGrey &img, unsigned int min_x, unsigned int min_y, unsigned int max_x, unsigned int max_y) | |
| Initialise to a new Image and copy over an area of img. More... | |
| ~ImageGrey () | |
| Destructor for ImageGrey class. More... | |
| void | set_pixel (unsigned int x, unsigned int y, PixelGrey level) |
| Set the grey level value of a pixel specified by (x,y). More... | |
| void | get_pixel (unsigned int x, unsigned int y, PixelGrey &p) |
| Return the value of the pixel specified by (x,y) in p. More... | |
| ImageGrey& | clear (int=0) |
| Set to value (clear) all of the pixels in the image. More... | |
| ImageGrey& | copy (ImageGrey &img) |
| Copy data from image data from img. More... | |
| ImageGrey& | copy (ImageGrey &img, unsigned int min_x, unsigned int min_y, unsigned int max_x, unsigned int max_y, unsigned int start_x, unsigned int start_y) |
| Copy data from block of image data from img. More... | |
| void | absolute () |
| Absolute value of brightness. | |
| void | threshold (int thresh) |
| Threshold brightness. More... | |
| bool | save (char *, FileFormat) |
| Save in graphics file format. More... | |
| ImageGrey& | operator= (ImageGrey &img) |
| Overload equals (=) operator for two images. | |
| ImageGrey& | operator-= (ImageGrey &img) |
| Overload equals (-=) operator for two images. More... | |
| ImageGrey& | operator+= (int fact) |
| Overload equals (+=) operator for Image and constant. More... | |
| ImageGrey& | operator-= (int fact) |
| Overload equals (-=) operator for Image and constant. More... | |
| ImageGrey& | operator/= (int fact) |
| Overload equals (/=) operator for Image and constant. More... | |
| ImageGrey& | operator *= (int fact) |
| Overload equals (*=) operator for Image and constant. More... | |
| bool | draw_line (int x_start, int y_start, int x_end, int y_end, PixelGrey intensity) |
| Method draws a straight line from point (x_start,y_start) to (x_end,y_end) of intensity described by brightness in PixelGrey intensity. More... | |
| bool | draw_filled_circle (unsigned int centre_x, unsigned int centre_y, unsigned int radius, PixelGrey intensity) |
| Method draws a filled circle with centre at point (centre_x,centre_y) of radius radius and brightness described by PixelGrey intensity. More... | |
| void | scale_down (unsigned int min_x, unsigned int min_y, unsigned int max_x, unsigned int max_y, unsigned int new_sx, unsigned int new_sy, float *new_image) |
| void | scale_down (unsigned int min_x, unsigned int min_y, unsigned int max_x, unsigned int max_y, unsigned int new_sx, unsigned int new_sy, double *new_image) |
| Scales a section of the image (min_x,min_y -> max_x,max_y) to a new buffer (new_image) of size new_sx*new_sy Scales by calculating the centre of scaled down point in original frame of reference and using a gaussian window. | |
| void | quick_scale_down (unsigned int min_x, unsigned int min_y, unsigned int max_x, unsigned int max_y, unsigned int new_sx, unsigned int new_sy, double *new_image) |
| Scales a section of the image (min_x,min_y -> max_x,max_y) to a new buffer (new_image) of size new_sx*new_sy Scales by calculating the centre of scaled down point in original frame of reference and using a gaussian window. | |
| float | convolve (unsigned int x, unsigned int y, CMatrix *conv_matrix) |
| Convolve image with a kernel. More... | |
| void | plot_conv_kernel (unsigned int x, unsigned int y, CMatrix *conv_matrix, float scale_fact, float offset) |
| Draws convolution kernel into image (for debug and visualisation). More... | |
| float | wavelet_convolve (unsigned int x, unsigned int y, Wavelet *wavelet, float *real, float *imag) |
| Performs convolutions with real and imaginary wavelet kernels. More... | |
| void | blur (unsigned int size, ImageGrey &result) |
| Blurs image by convolving with a matrix of equal values (1/(size*size)) of size size*size. More... | |
| bool | sobel_horizontal (ImageGrey &result) |
| Performs a horizontal sobel edge detection. More... | |
| bool | sobel_vertical (ImageGrey &result) |
| Performs a vertical sobel edge detection. More... | |
| bool | sobel (ImageGrey &result) |
| Performs a sobel (horizontal and vertical) edge detection. More... | |
| bool | median (unsigned int n, unsigned int m, ImageGrey &result) |
| Method performs a median filter on image over an nxm neighbourhood. More... | |
| bool | dilate (ImageGrey &result) |
| This method dilates the image by examining a 3x3 grid around all black pixels. More... | |
| bool | erode (ImageGrey &result) |
| This method errodes the image by examining a 3x3 grid around all white pixels. More... | |
| bool | errode (ImageGrey &result) |
| Method included for back-compatibility. | |
| bool | remove_point_noise (ImageGrey &result) |
| Method to remove isolated points from a binary image, result is stored in an object referenced by result. | |
| bool | region_identify (unsigned int max_regions, unsigned int &actual_regions, ImageGrey &result) |
| This method divides a binary image into spatially connected regions using the method described in "image processing, analysis and machine vision, Sonka, Hlavac and Boyle, pp197-8. More... | |
| bool | extract_region (int, ImageGrey &result) |
| Method to extract area where intensity value is region_no. More... | |
| void | normalise_intensity (float mean, float sd) |
| Calculates and normalises intensity values to specified mean and standard deviation. More... | |
| void | normalise_intensity_range () |
| Normalises intensity by adjusting min / max range to 0 -> 255 NOTE: Leaves image unchanged if all brightness values equal. | |
Public Attributes | |
| PixelGrey* | brightness |
| Greyscale image data. | |
The image is stored as an array of ints, each pixel represented as a single int.
Definition at line 39 of file ImageGrey.h.
|
|
Create an image with the given dimensions.
Definition at line 52 of file ImageGrey.cpp. |
|
|
Create an image from a graphics file. Sets the parameters Width and Height to the inputs width and height.
Definition at line 66 of file ImageGrey.cpp. |
|
|
Copy constructor.
Definition at line 38 of file ImageGrey.cpp. |
|
|
Initialise to a new Image and copy over an area of img.
Definition at line 158 of file ImageGrey.cpp. |
|
|
Destructor for ImageGrey class. Frees memory allocated to array: Definition at line 178 of file ImageGrey.cpp. |
|
|
Blurs image by convolving with a matrix of equal values (1/(size*size)) of size size*size.
Definition at line 185 of file ImageGrey-conv.cpp. |
|
|
Set to value (clear) all of the pixels in the image.
Definition at line 219 of file ImageGrey.cpp. Referenced by Image::clear_brightness().
|
|
|
Convolve image with a kernel. N.B. No check is made on the validity of the kernel centre w.r.t. kernel and image size.
Definition at line 29 of file ImageGrey-conv.cpp. |
|
|
Copy data from block of image data from img. Throws an exception if img is of incorrect size.
Definition at line 257 of file ImageGrey.cpp. |
|
|
Copy data from image data from img. Throws an exception if images are of different size.
Definition at line 235 of file ImageGrey.cpp. Referenced by ImageGrey(), Image::copy(), operator=(), and Image::operator=().
|
|
|
This method dilates the image by examining a 3x3 grid around all black pixels. If any pixel in this grid is true the pixel is set true. The result is stored in the object 'result'. The method returns false is either object is invalid or the objects are of different sizes. Definition at line 720 of file ImageGrey.cpp. |
|
|
Method draws a filled circle with centre at point (centre_x,centre_y) of radius radius and brightness described by PixelGrey intensity. The method returns false if any point is outside the image. Reimplemented in Image. Definition at line 230 of file Image-draw.cpp. Referenced by Image::draw_filled_circle().
|
|
|
Method draws a straight line from point (x_start,y_start) to (x_end,y_end) of intensity described by brightness in PixelGrey intensity. The method returns false if either point is outside the imagei. Reimplemented in Image. Definition at line 52 of file Image-draw.cpp. Referenced by Image::draw_line().
|
|
|
This method errodes the image by examining a 3x3 grid around all white pixels. If any pixel in this grid is false the pixel is set false. The result is stored in the object pointed to by result. The method returns false is either object is invalid or the objects are of different sizes. Definition at line 785 of file ImageGrey.cpp. |
|
|
Method to extract area where intensity value is region_no. All other areas are set to zero (background). Result is stored in the object pointed to by result. Note: Works on image generated by region_identify(). Region 0 = background, region 1 = largest region, region 2 = second largest etc. Definition at line 842 of file ImageGrey.cpp. |
|
|
Return the value of the pixel specified by (x,y) in p.
Definition at line 205 of file ImageGrey.cpp. Referenced by Image::get_brightness().
|
|
|
Method performs a median filter on image over an nxm neighbourhood. The result is stored in an object referenced by result. Definition at line 1232 of file ImageGrey.cpp. |
|
|
Calculates and normalises intensity values to specified mean and standard deviation.
Definition at line 1156 of file ImageGrey.cpp. |
|
|
Overload equals (*=) operator for Image and constant.
Definition at line 363 of file ImageGrey.cpp. |
|
|
Overload equals (+=) operator for Image and constant.
Definition at line 321 of file ImageGrey.cpp. |
|
|
Overload equals (-=) operator for Image and constant.
Definition at line 342 of file ImageGrey.cpp. |
|
|
Overload equals (-=) operator for two images.
Definition at line 406 of file ImageGrey.cpp. |
|
|
Overload equals (/=) operator for Image and constant.
Definition at line 384 of file ImageGrey.cpp. |
|
|
Draws convolution kernel into image (for debug and visualisation). N.B. No check is made on the validity of the kernel centre w.r.t. kernel and image size.
Definition at line 103 of file ImageGrey-conv.cpp. |
|
|
This method divides a binary image into spatially connected regions using the method described in "image processing, analysis and machine vision, Sonka, Hlavac and Boyle, pp197-8. Background pixels are left zero / false and other pixels set to 1->max_regions depending on what region they belong to. If the no. of regions exceeds max_regions the smallest regions are discarded and their pixels set to zero. The method returns false if either object is invalid or result is a different size or max_regions is negative. The no. of actual regions found (excluding 'background') is returned in actual_regions. Definition at line 877 of file ImageGrey.cpp. |
|
|
Save in graphics file format.
Definition at line 471 of file ImageGrey.cpp. |
|
|
Set the grey level value of a pixel specified by (x,y). Throws an exception if coordinates are not valid.
Definition at line 187 of file ImageGrey.cpp. Referenced by Image::set_brightness().
|
|
|
Performs a sobel (horizontal and vertical) edge detection. N.B. Result magnitudes may exceed 255. For visualisation use threshold() or /= 4.
Definition at line 645 of file ImageGrey.cpp. |
|
|
Performs a horizontal sobel edge detection. N.B. Result is normalised by dividing by 8
Definition at line 525 of file ImageGrey.cpp. |
|
|
Performs a vertical sobel edge detection. N.B. Result is normalised by dividing by 8
Definition at line 585 of file ImageGrey.cpp. |
|
|
Threshold brightness.
Definition at line 449 of file ImageGrey.cpp. |
|
|
Performs convolutions with real and imaginary wavelet kernels. Returns the SQUARE of the magnitude (for reasons of computational efficiency). N.B. No check is made on the validity of the kernel centre w.r.t. kernel and image size.
Definition at line 150 of file ImageGrey-conv.cpp. |
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001