Images

Summary
Images
ImageThe image type used in smartreader
Variables
channelVector of the channels that compose the image
n_channelsNumber of channels in the image
wWidth of the image
hHeight of the image
ROIRegion of interest on the image.
Functions
imageCreates a new image
imageGrayGetGets the value at position i, j from a gray image.If the parameters are invalid returns 0.
imageGraySetSets the value at position i, j from a gray image
imageGetGets the value at position i, j from a the n-th channel of the image.
imageSetSets the value at position i, j in the n-th channel of an image
imageCloneReturns a clone of img.
imageReadPGMReads a PGM image from path.
imageSavePGMSave an image to the file system
imageDeleteDelete the image
imageDrawRectDraws all the Rects in a IplImage using color.

Image

The image type used in smartreader

Summary
Variables
channelVector of the channels that compose the image
n_channelsNumber of channels in the image
wWidth of the image
hHeight of the image
ROIRegion of interest on the image.
Functions
imageCreates a new image
imageGrayGetGets the value at position i, j from a gray image.If the parameters are invalid returns 0.
imageGraySetSets the value at position i, j from a gray image
imageGetGets the value at position i, j from a the n-th channel of the image.
imageSetSets the value at position i, j in the n-th channel of an image
imageCloneReturns a clone of img.
imageReadPGMReads a PGM image from path.
imageSavePGMSave an image to the file system
imageDeleteDelete the image
imageDrawRectDraws all the Rects in a IplImage using color.

Variables

channel

Matrix **channel

Vector of the channels that compose the image

n_channels

int n_channels

Number of channels in the image

w

int w

Width of the image

h

int h

Height of the image

ROI

Rect *ROI

Region of interest on the image.  This is used in the IO functions.

Functions

image

Image *image(int width,
int height,
int n_channels)

Creates a new image

Parameters

width - height - n_channels -

Returns

A new image with all positions holding 0

imageGrayGet

int imageGrayGet(Image *img,
int i,
int j)

Gets the value at position i, j from a gray image.If the parameters are invalid returns 0.

Parameters

imgthe image to get the value from
irow
jcolumn Returns: The value of the i, j pixel See Also: Image

imageGraySet

void imageGraySet(Image *img,
int i,
int j,
int value)

Sets the value at position i, j from a gray image

Parameters

imgthe image to set the value from
irow
jcolumn
valuenew value See Also: Image

imageGet

int imageGet(Image *img,
int i,
int j,
int n)

Gets the value at position i, j from a the n-th channel of the image.  If the parameters are invalid returns 0

Parameters

imgthe image to get the value from
irow
jcolumn
nchannel to be used Returns: The value of the i, j pixel ot the n-th channel See Also: Image

imageSet

void imageSet(Image *img,
int i,
int j,
int n,
int value)

Sets the value at position i, j in the n-th channel of an image

Parameters

imgthe image to set the value
irow
jcolumn
nchannel to be used
valuenew value See Also: Image

imageClone

Image *imageClone(Image *img)

Returns a clone of img.  This functions uses ROI.

Parameters

imgimage to be cloned

Returns

Copy of img See Also: Image

imageReadPGM

Image *imageReadPGM(char *path)

Reads a PGM image from path.  Right now we only accept raw pgm.

Parameters

pathpath to the image to be loaded

Returns

The image stored on the PGM image on path.  See Also: <Image, imageSavePGM>

imageSavePGM

void imageSavePGM(Image *img,
char *path)

Save an image to the file system

Parameters

imgimage to be saved
pathpath to save the image

See Also

<Image, imageReadPGM>

imageDelete

void imageDelete(Image *img)

Delete the image

Parameters

imgthe image to delete See Also: Image

imageDrawRect

void imageDrawRect(Image *img,
Rect *r,
Color color,
int filled)

Draws all the Rects in a IplImage using color.

Parameters

rRect to be drawn
imgimage to draw the Rects into
colorcolor used
filled1 to fill the rectangle, 0 to draw just the lines.
Matrix **channel
Vector of the channels that compose the image
int n_channels
Number of channels in the image
int w
Width of the image
int h
Height of the image
Rect *ROI
Region of interest on the image.
Image *image(int width,
int height,
int n_channels)
Creates a new image
int imageGrayGet(Image *img,
int i,
int j)
Gets the value at position i, j from a gray image.If the parameters are invalid returns 0.
void imageGraySet(Image *img,
int i,
int j,
int value)
Sets the value at position i, j from a gray image
int imageGet(Image *img,
int i,
int j,
int n)
Gets the value at position i, j from a the n-th channel of the image.
void imageSet(Image *img,
int i,
int j,
int n,
int value)
Sets the value at position i, j in the n-th channel of an image
Image *imageClone(Image *img)
Returns a clone of img.
Image *imageReadPGM(char *path)
Reads a PGM image from path.
void imageSavePGM(Image *img,
char *path)
Save an image to the file system
void imageDelete(Image *img)
Delete the image
void imageDrawRect(Image *img,
Rect *r,
Color color,
int filled)
Draws all the Rects in a IplImage using color.
The image type used in smartreader
Close