ImageToArray Class |
Namespace: Accord.Imaging.Converters
public class ImageToArray : IConverter<Bitmap, double[]>, IConverter<UnmanagedImage, double[]>, IConverter<Bitmap, double[][]>, IConverter<UnmanagedImage, double[][]>, IConverter<Bitmap, float[]>, IConverter<UnmanagedImage, float[]>, IConverter<Bitmap, float[][]>, IConverter<UnmanagedImage, float[][]>, IConverter<Bitmap, Color[]>, IConverter<UnmanagedImage, Color[]>
The ImageToArray type exposes the following members.
Name | Description | |
---|---|---|
ImageToArray |
Initializes a new instance of the ImageToArray class.
| |
ImageToArray(Double, Double) |
Initializes a new instance of the ImageToArray class.
| |
ImageToArray(Double, Double, Int32) |
Initializes a new instance of the ImageToArray class.
|
Name | Description | |
---|---|---|
Channel |
Gets or sets the channel to be extracted.
| |
Max |
Gets or sets the maximum double value in the
double array associated with the brightest color.
| |
Min |
Gets or sets the minimum double value in the
double array associated with the darkest color.
|
Name | Description | |
---|---|---|
Convert(Bitmap, Double) |
Converts an image from one representation to another.
| |
Convert(Bitmap, Double) |
Converts an image from one representation to another.
| |
Convert(Bitmap, Color) |
Converts an image from one representation to another.
| |
Convert(Bitmap, Single) |
Converts an image from one representation to another.
| |
Convert(Bitmap, Single) |
Converts an image from one representation to another.
| |
Convert(UnmanagedImage, Double) |
Converts an image from one representation to another.
| |
Convert(UnmanagedImage, Double) |
Converts an image from one representation to another.
| |
Convert(UnmanagedImage, Color) |
Converts an image from one representation to another.
| |
Convert(UnmanagedImage, Single) |
Converts an image from one representation to another.
| |
Convert(UnmanagedImage, Single) |
Converts an image from one representation to another.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
This example converts a 16x16 Bitmap image into a double[] array with values between 0 and 1.
// Obtain a 16x16 bitmap image // Bitmap image = ... // Show on screen ImageBox.Show(image, PictureBoxSizeMode.Zoom); // Create the converter to convert the image to an // array containing only values between 0 and 1 ImageToArray conv = new ImageToArray(min: 0, max: 1); // Convert the image and store it in the array double[] array; conv.Convert(image, out array); // Show the array on screen ImageBox.Show(array, 16, 16, PictureBoxSizeMode.Zoom); ///
The resulting image is shown below.