The ImageData class is a helper class used to convert between Datum, other raw data, and Images such as a Bitmap.
More...
|
static Datum | GetImageData (Bitmap bmp, SimpleDatum sd, bool? bIsDataRealOverride=null, int[] rgFocusMap=null) |
| The GetImageData function converts a Bitmap into a Datum. More...
|
|
static Datum | GetImageDataD (Bitmap bmp, int nChannels, bool bDataIsReal, int nLabel, bool bUseLockBitmap=true, int[] rgFocusMap=null) |
| The GetImageDataD function converts a Bitmap into a Datum using the double type for real data. More...
|
|
static Datum | GetImageDataF (Bitmap bmp, int nChannels, bool bDataIsReal, int nLabel, bool bUseLockBitmap=true, int[] rgFocusMap=null) |
| The GetImageDataF function converts a Bitmap into a Datum using the float type for real data. More...
|
|
static Datum | GetImageData< T > (T[] rgData, int nChannels, int nHeight, int nWidth, bool bDataIsReal, int nStartIdx=0, int nCount=-1) |
| The GetImageData function converts an array of type 'T' into a Datum. More...
|
|
static Bitmap | GetImageAtChannel (SimpleDatum d, int nChannel, ColorMapper clrMap=null, List< int > rgClrOrder=null) |
| Converts a SimplDatum (or Datum) into an image, optionally using a ColorMapper. More...
|
|
static Bitmap | GetImage (SimpleDatum d, ColorMapper clrMap=null, List< int > rgClrOrder=null) |
| Converts a SimplDatum (or Datum) into an image, optionally using a ColorMapper. More...
|
|
static Bitmap | GetImage (List< Result > rg, Size sz, ColorMapper clrMap) |
| Converts a list of KeyValuePairs into an image using a ColorMapper. More...
|
|
static int[] | LoadFocusMap (string strImgFile) |
| Load a black/white image as a focus map where any area not colored black is attributed focus. The resulting map is used to mask out all other data in the actual data images. More...
|
|
The ImageData class is a helper class used to convert between Datum, other raw data, and Images such as a Bitmap.
Definition at line 13 of file ImageData.cs.
◆ GetImage() [1/2]
static Bitmap MyCaffe.basecode.ImageData.GetImage |
( |
List< Result > |
rg, |
|
|
Size |
sz, |
|
|
ColorMapper |
clrMap |
|
) |
| |
|
static |
Converts a list of KeyValuePairs into an image using a ColorMapper.
- Parameters
-
rg | Specifies a KeyValuePair where the Value is converted to a color. |
sz | Specifies the size of the image. |
clrMap | Specifies a color mapper to use when converting each value into a color. |
- Returns
- The Image of the data is returned.
Definition at line 651 of file ImageData.cs.
◆ GetImage() [2/2]
static Bitmap MyCaffe.basecode.ImageData.GetImage |
( |
SimpleDatum |
d, |
|
|
ColorMapper |
clrMap = null , |
|
|
List< int > |
rgClrOrder = null |
|
) |
| |
|
static |
Converts a SimplDatum (or Datum) into an image, optionally using a ColorMapper.
- Parameters
-
d | Specifies the Datum to use. |
clrMap | Optionally, specifies a color mapper to use when converting each value into a color (default = null, not used). |
rgClrOrder | Optionally, specifies the color ordering. Note, this list must have the same number of elements as there are channels. |
- Returns
- The Image of the data is returned.
Definition at line 506 of file ImageData.cs.
◆ GetImageAtChannel()
static Bitmap MyCaffe.basecode.ImageData.GetImageAtChannel |
( |
SimpleDatum |
d, |
|
|
int |
nChannel, |
|
|
ColorMapper |
clrMap = null , |
|
|
List< int > |
rgClrOrder = null |
|
) |
| |
|
static |
Converts a SimplDatum (or Datum) into an image, optionally using a ColorMapper.
- Parameters
-
d | Specifies the Datum to use. |
nChannel | Specifies to only use the data along a given channel to color the image. |
clrMap | Optionally, specifies a color mapper to use when converting each value into a color (default = null, not used). |
rgClrOrder | Optionally, specifies the color ordering. Note, this list must have the same number of elements as there are channels. |
- Returns
- The Image of the data is returned.
Definition at line 371 of file ImageData.cs.
◆ GetImageData()
static Datum MyCaffe.basecode.ImageData.GetImageData |
( |
Bitmap |
bmp, |
|
|
SimpleDatum |
sd, |
|
|
bool? |
bIsDataRealOverride = null , |
|
|
int[] |
rgFocusMap = null |
|
) |
| |
|
static |
The GetImageData function converts a Bitmap into a Datum.
- Parameters
-
bmp | Specifies the Bitmap containing the image. |
sd | Specifies the SimpleDatum that defines the channels, 'IsDataReal' and label settings. |
bIsDataRealOverride | Optionally, specifies an override for the 'IsDataReal' setting. |
rgFocusMap | Specifies a focus map previously loaded with LoadFocusMap. |
- Returns
- The Datum representing the image is returned.
Definition at line 23 of file ImageData.cs.
◆ GetImageData< T >()
The GetImageData function converts an array of type 'T' into a Datum.
- Parameters
-
rgData | Specifies the array of type 'T'. |
nChannels | Specifies the number of channels contained in the Bitmap (e.g. 3 = color, 1 = black and white). |
nHeight | Specifies the height of the data. |
nWidth | Specifies the width of the data. |
bDataIsReal | Specifies whether or not to add each color to the List of double or to the list of byte. Using the byte array is more common for it already separates a 3 color Bitmap into 3 channels of data. |
nStartIdx | Specifies where to start the conversion within the data. |
nCount | Specifies the number of items within the data to convert. |
- Returns
- The Datum representing the image is returned.
Definition at line 319 of file ImageData.cs.
◆ GetImageDataD()
static Datum MyCaffe.basecode.ImageData.GetImageDataD |
( |
Bitmap |
bmp, |
|
|
int |
nChannels, |
|
|
bool |
bDataIsReal, |
|
|
int |
nLabel, |
|
|
bool |
bUseLockBitmap = true , |
|
|
int[] |
rgFocusMap = null |
|
) |
| |
|
static |
The GetImageDataD function converts a Bitmap into a Datum using the double type for real data.
- Parameters
-
bmp | Specifies the Bitmap containing the image. |
nChannels | Specifies the number of channels contained in the Bitmap (e.g. 3 = color, 1 = black and white). |
bDataIsReal | Specifies whether or not to add each color to the List of double or to the list of byte. Using the byte array is more common for it already separates a 3 color Bitmap into 3 channels of data. |
nLabel | Specifies the known label. |
bUseLockBitmap | Optionally, use the Lock Bitmap which is faster but may produce corrupted images in a few scenarios (default = true). |
rgFocusMap | Optionally, specifies a focus map where values = 1 are used, and all other values are masked out to 0. |
- Returns
- The Datum representing the image is returned.
Definition at line 44 of file ImageData.cs.
◆ GetImageDataF()
static Datum MyCaffe.basecode.ImageData.GetImageDataF |
( |
Bitmap |
bmp, |
|
|
int |
nChannels, |
|
|
bool |
bDataIsReal, |
|
|
int |
nLabel, |
|
|
bool |
bUseLockBitmap = true , |
|
|
int[] |
rgFocusMap = null |
|
) |
| |
|
static |
The GetImageDataF function converts a Bitmap into a Datum using the float type for real data.
- Parameters
-
bmp | Specifies the Bitmap containing the image. |
nChannels | Specifies the number of channels contained in the Bitmap (e.g. 3 = color, 1 = black and white). |
bDataIsReal | Specifies whether or not to add each color to the List of double or to the list of byte. Using the byte array is more common for it already separates a 3 color Bitmap into 3 channels of data. |
nLabel | Specifies the known label. |
bUseLockBitmap | Optionally, use the Lock Bitmap which is faster but may produce corrupted images in a few scenarios (default = true). |
rgFocusMap | Optionally, specifies a focus map where values = 1 are used, and all other values are masked out to 0. |
- Returns
- The Datum representing the image is returned.
Definition at line 181 of file ImageData.cs.
◆ LoadFocusMap()
static int[] MyCaffe.basecode.ImageData.LoadFocusMap |
( |
string |
strImgFile | ) |
|
|
static |
Load a black/white image as a focus map where any area not colored black is attributed focus. The resulting map is used to mask out all other data in the actual data images.
- Parameters
-
strImgFile | Specifies the black and white focus image. |
- Returns
- Returns a list of integers in the form WWWWW1 WWWWW2 ... WWWWWH
Definition at line 758 of file ImageData.cs.
The documentation for this class was generated from the following file:
- C:/Data/Data/SS_Projects/Intelligence/GitHub/MyCaffe/MyCaffe.basecode/ImageData.cs