SA_Image


Description

SA_Image wraps an MxNx3 Matrix that represents an Image


Constructor:

Image = SA_Image(SrcMatrix)

SrcMatrix: [M x N x 3] Uint8 Matrix; The matrix containing the image.

Image: object of type SA_Image;

Creates a new instance of the class SA_Image with the passed matrix SrcMatrix.


Public Functions:

draw(Image)

Image: SA_Image; The image to be drawn.

Displays the Image using the Matlab viewer.



color = get(Image, x, y)

Image: SA_Image; The image used.
x: Float; x coordinate on the Image.
y: Float; y coordinate on the Image.

color: [3 x 1] Uint8 Vector; The color at x,y.

Returns the color vector at the position (x,y) of the Image. If the index position is outside of the image, [0,0,0] is returned.



BoundaryList = getBoundaries(Image)

Image: SA_Image; The image used.

BoundaryList: SA_VectorArray; A list of the boundaries on the Image with absolute positions.

BoundaryList is a list of boundary path vectors on the image. The function extracts patches of the same color and traces the boundaries of them. A boundary is a [N x 2] Float Matrix where each row represents an absolute position on the image. The color black (0,0,0) is interpreted as empty and not extracted.



Image = set(Image,x,y,color)

Image: SA_Image; The image used.
x: Float; x coordinate on the Image.
y: Float; y coordinate on the Image.
color: [3 x 1] Uint8 Matrix; The color to be set.

Image: SA_Image; The image used.

Sets the color of the image at (x,y) to the passed value color.



Image = setR(Image,x,y,r)

Image: SA_Image; The image used.
x: Float; x coordinate on the Image.
y: Float; y coordinate on the Image.
r: Uint8; Red color component.

Image: SA_Image; The image used.

Sets the red color component of the image at (x,y) to the passed value color.



Image = setG(Image,x,y,g)

Image: SA_Image; The image used.
x: Float; x coordinate on the Image.
y: Float; y coordinate on the Image.
g: Uint8; Green color component.

Image: SA_Image; The image used.

Sets the green color component of the image at (x,y) to the passed value color.



Image = setB(Image,x,y,b)

Image: SA_Image; The image used.
x: Float; x coordinate on the Image.
y: Float; y coordinate on the Image.
b: Uint8; Blue color component.

Image: SA_Image; The image used.

Sets the blue color component of the image at (x,y) to the passed value color.



Private Functions:

Bitmask = SA_getPatchBitmask(SrcImg, start_x, start_y)

Boundary = SA_traceBoundary(Bitmask, Img)




Copyright © 2007 Thomas Oskam, ETH Zürich. All rights reserved.