C# Class Accord.Imaging.Tools

Static tool functions for imaging.

References: P. D. Kovesi. MATLAB and Octave Functions for Computer Vision and Image Processing. School of Computer Science and Software Engineering, The University of Western Australia. Available in: http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/Match/matchbycorrelation.m

Show file Open project: accord-net/framework Class Usage Examples

Public Methods

Method Description
Center ( this rectangle ) : Point

Computes the center of a given rectangle.

Collinear ( PointF pt1, PointF pt2, PointF pt3 ) : bool

Detects if three points are collinear.

Collinear ( Accord.Imaging.PointH pt1, Accord.Imaging.PointH pt2, Accord.Imaging.PointH pt3 ) : bool

Detects if three points are collinear.

Fundamental ( PointF points1, PointF points2 ) : ].float[

Creates the fundamental matrix between two images from a set of points from each image.

Fundamental ( Accord.Imaging.PointH points1, Accord.Imaging.PointH points2 ) : ].float[

Creates the fundamental matrix between two images from a set of points from each image.

Fundamental ( Accord.Imaging.PointH points1, Accord.Imaging.PointH points2, Accord.Imaging.PointH &epipoles ) : ].float[

Creates the fundamental matrix between two images from a set of points from each image.

GetFormat ( string fileName ) : ImageFormat

Gets the image format most likely associated with a given file name.

Homography ( PointF points1, PointF points2 ) : MatrixH

Creates an homography matrix matching points from a set of points to another.

Homography ( Accord.Imaging.PointH points1, Accord.Imaging.PointH points2 ) : MatrixH

Creates an homography matrix matching points from a set of points to another.

InnerProduct ( this a, PointF b ) : float

Computes the inner product of two points.

IsEqual ( this objA, Rectangle objB, int threshold ) : bool

Compares two rectangles for equality, considering an acceptance threshold.

Max ( this image ) : int

Computes the maximum pixel value in the given image.

Max ( this image, Rectangle rectangle ) : int

Computes the maximum pixel value in the given image.

Max ( this image, int channel ) : int

Computes the maximum pixel value in the given image.

Mean ( this image ) : double

Computes the arithmetic mean of the pixels in a given image.

Mean ( this image, Rectangle rectangle ) : double

Computes the arithmetic mean of the pixels in a given image.

Min ( this image ) : int

Computes the minimum pixel value in the given image.

Min ( this image, Rectangle rectangle ) : int

Computes the minimum pixel value in the given image.

Min ( this image, int channel ) : int

Computes the maximum pixel value in the given image.

Multiply ( this transformationMatrix, PointF point ) : float[]

Multiplies a transformation matrix and a point.

Multiply ( this point, float transformationMatrix ) : float[]

Multiplies a point by a transformation matrix.

Normalize ( this points, MatrixH &transformation ) : System.Drawing.PointF[]

Normalizes a set of homogeneous points so that the origin is located at the centroid and the mean distance to the origin is sqrt(2).

Normalize ( this points, float &transformation ) : System.Drawing.PointF[]

Normalizes a set of homogeneous points so that the origin is located at the centroid and the mean distance to the origin is sqrt(2).

Normalize ( this points, MatrixH &transformation ) : Accord.Imaging.PointH[]

Normalizes a set of homogeneous points so that the origin is located at the centroid and the mean distance to the origin is sqrt(2).

Normalize ( this points, float &transformation ) : Accord.Imaging.PointH[]

Normalizes a set of homogeneous points so that the origin is located at the centroid and the mean distance to the origin is sqrt(2).

StandardDeviation ( this image, Rectangle rectangle, double mean ) : double

Computes the standard deviation of image pixels.

StandardDeviation ( this image, double mean ) : double

Computes the standard deviation of image pixels.

Sum ( this image ) : int

Computes the sum of the pixels in a given image.

Sum ( this image, Rectangle rectangle ) : int

Computes the sum of the pixels in a given image.

Sum ( this image, Rectangle rectangle ) : long

Computes the sum of the pixels in a given image.

TransformPoints ( this fundamentalMatrix ) : System.Drawing.PointF[]

Transforms the given points using this transformation matrix.

Private Methods

Method Description
ToBitmap ( this pixels ) : Bitmap
ToBitmap ( this pixels, int width, int height ) : Bitmap
ToBitmap ( this pixels, int width, int height, double min, double max ) : Bitmap
ToDoubleArray ( this image, int channel ) : double[]
ToDoubleArray ( this image, int channel, double min, double max ) : double[]
ToDoubleArray ( this image ) : double[][]
ToDoubleArray ( this image, double min, double max ) : double[][]
ToDoubleMatrix ( this image, int channel ) : ].double[
ToDoubleMatrix ( this image, int channel, double min, double max ) : ].double[
createFundamentalMatrix ( float A ) : ].float[

Method Details

Center() public static method

Computes the center of a given rectangle.
public static Center ( this rectangle ) : Point
rectangle this
return Point

Collinear() public static method

Detects if three points are collinear.
public static Collinear ( PointF pt1, PointF pt2, PointF pt3 ) : bool
pt1 System.Drawing.PointF
pt2 System.Drawing.PointF
pt3 System.Drawing.PointF
return bool

Collinear() public static method

Detects if three points are collinear.
public static Collinear ( Accord.Imaging.PointH pt1, Accord.Imaging.PointH pt2, Accord.Imaging.PointH pt3 ) : bool
pt1 Accord.Imaging.PointH
pt2 Accord.Imaging.PointH
pt3 Accord.Imaging.PointH
return bool

Fundamental() public static method

Creates the fundamental matrix between two images from a set of points from each image.
public static Fundamental ( PointF points1, PointF points2 ) : ].float[
points1 System.Drawing.PointF
points2 System.Drawing.PointF
return ].float[

Fundamental() public static method

Creates the fundamental matrix between two images from a set of points from each image.
public static Fundamental ( Accord.Imaging.PointH points1, Accord.Imaging.PointH points2 ) : ].float[
points1 Accord.Imaging.PointH
points2 Accord.Imaging.PointH
return ].float[

Fundamental() public static method

Creates the fundamental matrix between two images from a set of points from each image.
public static Fundamental ( Accord.Imaging.PointH points1, Accord.Imaging.PointH points2, Accord.Imaging.PointH &epipoles ) : ].float[
points1 Accord.Imaging.PointH
points2 Accord.Imaging.PointH
epipoles Accord.Imaging.PointH
return ].float[

GetFormat() public static method

Gets the image format most likely associated with a given file name.
public static GetFormat ( string fileName ) : ImageFormat
fileName string The filename in the form "image.jpg".
return System.Drawing.Imaging.ImageFormat

Homography() public static method

Creates an homography matrix matching points from a set of points to another.
public static Homography ( PointF points1, PointF points2 ) : MatrixH
points1 System.Drawing.PointF
points2 System.Drawing.PointF
return MatrixH

Homography() public static method

Creates an homography matrix matching points from a set of points to another.
public static Homography ( Accord.Imaging.PointH points1, Accord.Imaging.PointH points2 ) : MatrixH
points1 Accord.Imaging.PointH
points2 Accord.Imaging.PointH
return MatrixH

InnerProduct() public static method

Computes the inner product of two points.
public static InnerProduct ( this a, PointF b ) : float
a this
b System.Drawing.PointF
return float

IsEqual() public static method

Compares two rectangles for equality, considering an acceptance threshold.
public static IsEqual ( this objA, Rectangle objB, int threshold ) : bool
objA this
objB System.Drawing.Rectangle
threshold int
return bool

Max() public static method

Computes the maximum pixel value in the given image.
public static Max ( this image ) : int
image this
return int

Max() public static method

Computes the maximum pixel value in the given image.
public static Max ( this image, Rectangle rectangle ) : int
image this
rectangle System.Drawing.Rectangle
return int

Max() public static method

Computes the maximum pixel value in the given image.
public static Max ( this image, int channel ) : int
image this
channel int
return int

Mean() public static method

Computes the arithmetic mean of the pixels in a given image.
public static Mean ( this image ) : double
image this
return double

Mean() public static method

Computes the arithmetic mean of the pixels in a given image.
public static Mean ( this image, Rectangle rectangle ) : double
image this
rectangle System.Drawing.Rectangle
return double

Min() public static method

Computes the minimum pixel value in the given image.
public static Min ( this image ) : int
image this
return int

Min() public static method

Computes the minimum pixel value in the given image.
public static Min ( this image, Rectangle rectangle ) : int
image this
rectangle System.Drawing.Rectangle
return int

Min() public static method

Computes the maximum pixel value in the given image.
public static Min ( this image, int channel ) : int
image this
channel int
return int

Multiply() public static method

Multiplies a transformation matrix and a point.
public static Multiply ( this transformationMatrix, PointF point ) : float[]
transformationMatrix this
point System.Drawing.PointF
return float[]

Multiply() public static method

Multiplies a point by a transformation matrix.
public static Multiply ( this point, float transformationMatrix ) : float[]
point this
transformationMatrix float
return float[]

Normalize() public static method

Normalizes a set of homogeneous points so that the origin is located at the centroid and the mean distance to the origin is sqrt(2).
public static Normalize ( this points, MatrixH &transformation ) : System.Drawing.PointF[]
points this
transformation MatrixH
return System.Drawing.PointF[]

Normalize() public static method

Normalizes a set of homogeneous points so that the origin is located at the centroid and the mean distance to the origin is sqrt(2).
public static Normalize ( this points, float &transformation ) : System.Drawing.PointF[]
points this
transformation float
return System.Drawing.PointF[]

Normalize() public static method

Normalizes a set of homogeneous points so that the origin is located at the centroid and the mean distance to the origin is sqrt(2).
public static Normalize ( this points, MatrixH &transformation ) : Accord.Imaging.PointH[]
points this
transformation MatrixH
return Accord.Imaging.PointH[]

Normalize() public static method

Normalizes a set of homogeneous points so that the origin is located at the centroid and the mean distance to the origin is sqrt(2).
public static Normalize ( this points, float &transformation ) : Accord.Imaging.PointH[]
points this
transformation float
return Accord.Imaging.PointH[]

StandardDeviation() public static method

Computes the standard deviation of image pixels.
public static StandardDeviation ( this image, Rectangle rectangle, double mean ) : double
image this
rectangle System.Drawing.Rectangle
mean double
return double

StandardDeviation() public static method

Computes the standard deviation of image pixels.
public static StandardDeviation ( this image, double mean ) : double
image this
mean double
return double

Sum() public static method

Computes the sum of the pixels in a given image.
public static Sum ( this image ) : int
image this
return int

Sum() public static method

Computes the sum of the pixels in a given image.
public static Sum ( this image, Rectangle rectangle ) : int
image this
rectangle System.Drawing.Rectangle
return int

Sum() public static method

Computes the sum of the pixels in a given image.
public static Sum ( this image, Rectangle rectangle ) : long
image this
rectangle System.Drawing.Rectangle
return long

TransformPoints() public static method

Transforms the given points using this transformation matrix.
public static TransformPoints ( this fundamentalMatrix ) : System.Drawing.PointF[]
fundamentalMatrix this
return System.Drawing.PointF[]