MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.basecode.ImageTools Class Reference

The ImageTools class is a helper class used to manipulate image data. More...

Public Types

enum  ADJUSTCONTRAST_ORDERING { BRIGHTNESS_CONTRAST_GAMMA , BRIGHTNESS_GAMMA_CONTRAST }
 Defines the odering for which the AdjustContrast applies brightness, contrast and gamma adjustments. More...
 

Static Public Member Functions

static Bitmap ResizeImage (Image image, int width, int height)
 Resize the image to the specified width and height. More...
 
static Bitmap AdjustContrast (Image bmp, float fBrightness=0.0f, float fContrast=1.0f, float fGamma=1.0f)
 The AdjustContrast function adjusts the brightness, contrast and gamma of the image and returns the newly adjusted image. More...
 
static void AdjustContrast (SimpleDatum sd, float fBrightness=0.0f, float fContrast=1.0f, float fGamma=1.0f, ADJUSTCONTRAST_ORDERING ordering=ADJUSTCONTRAST_ORDERING.BRIGHTNESS_CONTRAST_GAMMA)
 The AdjustContrast function adjusts the brightness, contrast and gamma of the image and returns the newly adjusted image. More...
 
static byte[] ImageToByteArray (Image imageIn)
 Converts an Image into an array of byte. More...
 
static Image ByteArrayToImage (byte[] byteArrayIn)
 Converts an array of byte into an Image. More...
 
static Image Center (Bitmap bmp, Color clrBackground)
 Find the first and last colored rows of an image and centers the colored portion of the image vertically. More...
 

Detailed Description

The ImageTools class is a helper class used to manipulate image data.

Definition at line 15 of file ImageTools.cs.

Member Enumeration Documentation

◆ ADJUSTCONTRAST_ORDERING

Defines the odering for which the AdjustContrast applies brightness, contrast and gamma adjustments.

Enumerator
BRIGHTNESS_CONTRAST_GAMMA 

Applies brightness, then contrast, then adjust gamma.

BRIGHTNESS_GAMMA_CONTRAST 

Applies brightness, then adjusts gamma, then adjusts contrast.

Definition at line 20 of file ImageTools.cs.

Member Function Documentation

◆ AdjustContrast() [1/2]

static Bitmap MyCaffe.basecode.ImageTools.AdjustContrast ( Image  bmp,
float  fBrightness = 0.0f,
float  fContrast = 1.0f,
float  fGamma = 1.0f 
)
static

The AdjustContrast function adjusts the brightness, contrast and gamma of the image and returns the newly adjusted image.

Parameters
bmpSpecifies the image to adjust.
fBrightnessSpecifies the brightness to apply.
fContrastSpecifies the contrast to apply.
fGammaSpecifies the gamma to apply.
Returns
The updated image is returned.

Definition at line 75 of file ImageTools.cs.

◆ AdjustContrast() [2/2]

static void MyCaffe.basecode.ImageTools.AdjustContrast ( SimpleDatum  sd,
float  fBrightness = 0.0f,
float  fContrast = 1.0f,
float  fGamma = 1.0f,
ADJUSTCONTRAST_ORDERING  ordering = ADJUSTCONTRAST_ORDERING.BRIGHTNESS_CONTRAST_GAMMA 
)
static

The AdjustContrast function adjusts the brightness, contrast and gamma of the image and returns the newly adjusted image.

Parameters
sdSpecifies the SimpleDatum to adjust.
fBrightnessSpecifies the brightness to apply.
fContrastSpecifies the contrast to apply.
fGammaSpecifies the gamma to apply.
orderingSpecifies the ordering for which the brightness, contrast and gamma are applied.
Returns
The updated image is returned.

Definition at line 177 of file ImageTools.cs.

◆ ByteArrayToImage()

static Image MyCaffe.basecode.ImageTools.ByteArrayToImage ( byte[]  byteArrayIn)
static

Converts an array of byte into an Image.

Parameters
byteArrayInSpecifies the array of byte.
Returns
The Image is returned.

Definition at line 249 of file ImageTools.cs.

◆ Center()

static Image MyCaffe.basecode.ImageTools.Center ( Bitmap  bmp,
Color  clrBackground 
)
static

Find the first and last colored rows of an image and centers the colored portion of the image vertically.

Parameters
bmpSpecifies the image to center.
clrBackgroundSpecifies the back-ground color to use for the non-colored portions.
Returns
The centered Image is returned.

Definition at line 263 of file ImageTools.cs.

◆ ImageToByteArray()

static byte[] MyCaffe.basecode.ImageTools.ImageToByteArray ( Image  imageIn)
static

Converts an Image into an array of byte.

Parameters
imageInSpecifies the Image.
Returns
The array of byte is returned.

Definition at line 236 of file ImageTools.cs.

◆ ResizeImage()

static Bitmap MyCaffe.basecode.ImageTools.ResizeImage ( Image  image,
int  width,
int  height 
)
static

Resize the image to the specified width and height.

Parameters
imageThe image to resize.
widthThe width to resize to.
heightThe height to resize to.
Returns
The resized image.

Definition at line 39 of file ImageTools.cs.


The documentation for this class was generated from the following file: