qvdta Namespace Reference

Computer Vision Data types and Algorithms. More...


Classes

class  QVComponentTree
 Image component tree data structure. More...
class  QVDisjointSet
 Implementation of a disjoint set data type, based on the union-find algorithm. More...
class  QVMSER
 Maximally stable extremal region datatype. More...
class  QVPolyline
 Polyline representation. More...

Functions

void pruneLowComponentTreeAux (QVImage< uChar > &image, QVComponentTree &componentTree, uInt minArea, uInt node, uInt validThreshold)
void pruneHighComponentTreeAux (QVImage< uChar > &image, QVComponentTree &componentTree, uInt minArea, uInt node, uInt validThreshold)
void FilterComponentTreeSmallRegions (QVImage< uChar > &image, QVComponentTree &componentTree, uInt minArea)
QVPolyline getConnectedSetBorderContourThreshold (const QVImage< uChar > &image, const QPoint point, const uChar threshold=128)
 Obtains the border contour of a connected set of pixels in an image, given a membership condition.
QList< QVPolylinegetConnectedSetBorderContoursThreshold (const QVImage< uChar > &image, const uChar threshold=128)
 Obtains a list of the border contours of the connected sets in an image, according to a membership condition.
QVPolyline getLineContourThreshold4Connectivity (QVImage< uChar > &image, const QPoint point, QVPolyline &polyline, const uChar threshold, bool reverse)
QList< QVPolylinegetLineContoursThreshold4Connectivity (const QVImage< uChar > &image, const uChar threshold=128)
 Obtains a list of the 4-connected contour lines in the image.
QVPolyline getLineContourThreshold8Connectivity (QVImage< uChar > &image, const QPoint point, QVPolyline &polyline, const uChar threshold, bool reverse)
QList< QVPolylinegetLineContoursThreshold8Connectivity (const QVImage< uChar > &image, const uChar threshold=128)
 Obtains a list of the 8-connected contour lines in the image.
QVector< QVector
< QPoint > > 
CountingSort (const QVImage< uChar, 1 > &img)
 Sorts pixels in an image, given their gray-scale value.
void HarrisCornerResponseImage (const QVImage< uChar > &image, QVImage< sFloat > &result)
void SobelCornerResponseImage (const QVImage< uChar > &image, QVImage< sFloat > &result)
void FilterLocalMax (const QVImage< sFloat > &src, QVImage< uChar > &dest, uInt colMaskSize, uInt rowMaskSize, sFloat threshold=0)
 Generates a binary image of local grey-scale maximal value pixels.
int myFloodFill (QVImage< uChar > &image, uInt x, uInt y, uInt value, uInt minVal, uInt maxVal)
void getMSERContours (const QVImage< uChar, 1 > &image, const QList< QVMSER > &MSERList, QList< qvdta::QVPolyline > &polylineMSERList)
 Obtains border contours for an MSER list, obtained with the function getMSER.
void getMSER (const QVImage< uChar, 1 > &image, QList< QVMSER > &MSERList, const int delta, const int minArea, const int maxArea, const double diffAreaThreshold)
 This algorithm obtains MSER's - from an image.
void IterativePointElimination (const QVPolyline &polyline, QVPolyline &result, const double minArea)
 Simplifies a contour eliminating points of little area using IPE algorithm.
QPoint linesIntersection (QPoint a, QPoint b, QPoint c, QPoint d)
void drawPoints (const QList< QPoint > &hotPoints, QVImage< uChar, 3 > &dest)
void drawPoints (const QList< QPoint > &hotPoints, QVImage< uChar > &dest)
void draw (QVImage< uChar > &image, const QVPolyline &polyline, const uChar constant, bool linked, bool safe)
void draw (QVImage< uChar, 3 > &image, const QVPolyline &polyline, const uChar constant[3], bool linked, bool safe)
void draw (QVImage< uChar > &img, const QList< QVPolyline > &polylineList, const uChar constant, bool linked, bool safe)
void draw (QVImage< uChar, 3 > &img, const QList< QVPolyline > &polylineList, const uChar constant[3], bool linked, bool safe)


Detailed Description

Computer Vision Data types and Algorithms.

See Structure for a detailed explanation of the structure of this package.


Function Documentation

QVector< QVector< QPoint > > qvdta::CountingSort ( const QVImage< uChar, 1 > &  img  ) 

Sorts pixels in an image, given their gray-scale value.

This function obtains a QVector, that maps any gray-scale values (0..255) to the set of QPoints that hold that gray-scale value, in a given image. It can be used for very fast pixel sorting.

The function itself is based in Counting Sort algorithm , so the cost of this function is O(number_of_columns * number_of_rows).

Parameters:
img source image to obtain sorted lists of QPoints.
Returns:
A QVector, indexed by the gray-scale value (0-255), to a QVector of QPoints, containing the corresponding points to the pixels that hold that gray-scale value in the image.

Definition at line 30 of file qvdta.cpp.

References QVImage< Type, Channels >::getCols(), QVImage< Type, Channels >::getRows(), qvipp::HistogramRange(), QVIMAGE_INIT_READ, and QVIMAGE_PIXEL.

void qvdta::FilterLocalMax ( const QVImage< sFloat > &  src,
QVImage< uChar > &  dest,
uInt  colMaskSize,
uInt  rowMaskSize,
sFloat  threshold = 0 
)

Generates a binary image of local grey-scale maximal value pixels.

This function receives a QVImage, and generates a binary image where each pixel is set to IPP_MAX_8U if the pixel in the original image is strict maximal in value regarding to pixels in a vicinity window of colMaskSize width, and rowMaskSize height.

Todo:
  • Fix resulting image ROI, obtain maximums restricted to the ROI.
  • Use IPP functions to obtain the result.
Parameters:
src source image.
dest binary image that will contain maximal values.
colMaskSize width of the vicinity.
rowMaskSize height of the vicinity.

Definition at line 93 of file qvdta.cpp.

References QVImage< Type, Channels >::getCols(), QVImage< Type, Channels >::getRows(), QVIMAGE_INIT_READ, QVIMAGE_INIT_WRITE, QVIMAGE_PIXEL, and qvipp::Set().

QList< QVPolyline > qvdta::getConnectedSetBorderContoursThreshold ( const QVImage< uChar > &  image,
const uChar  threshold = 128 
)

Obtains a list of the border contours of the connected sets in an image, according to a membership condition.

This function gets the border contours for all of the connected sets of pixels in an image, using the function getContourThreshold, and returns them in a list of polylines (QList<QVPolyline>).

Thus, it considers every point inside a connected set, if it has a gray-level equal or higher than a given value. An example of the contours obtained is depicted in the next image:

bordercontours.png

Circles indicate the first of the pixels in each border set, and following pixels are joined with a continuous line, until the last of the pixels in the set, depicted with an asterisk.

Parameters:
image image from were to obtain the poly-lines.
threshold threshold to consider pixels inside or outside the connected sets.
Returns:
a QList of QVPolyline's that follows the border sets of the connected sets in the image.
See also:
getConnectedSetBorderContourThreshold

Definition at line 139 of file qvcontour.cpp.

QVPolyline qvdta::getConnectedSetBorderContourThreshold ( const QVImage< uChar > &  image,
const QPoint  startPoint,
const uChar  threshold 
)

Obtains the border contour of a connected set of pixels in an image, given a membership condition.

A contour is a sequence of pixels from an image, were every two contiguous pixels in the sequence are neighbours in the image.

This function obtains the contour that depicts the border set of a connected set of pixels in an image, given a membership condition.

For this border contour extractor function, the membership condition will be that pixels will be considered to be members of a connected if and only if their gray-scale value is equal or greater than a given threshold value.

The function implements an automata, that will receive an image and a starting point in its arguments, and will look for the closest border pixel to that point.

That border pixel will have a gray-level value equal or higher than a threshold value, given also in the arguments of the function, and will transverse the border of the set, appending every point that it finds in it in a QVPolyline object, that will be the returning value of the function.

Border contours obtained with this function can be either inner borders (corresponding to the border of an empty space inside the connected set) or the outer border of the connected set. The programer can tell wether a given border is inner or outer by the boolean value QVPolyline::direction, which will store TRUE for an outer contour, and FALSE for an inner contour.

Parameters:
image image from were to obtain the poly-line.
point any point inside the connected set.
threshold threshold to consider pixels inside or outside the connected set.
Returns:
a QVPolyline that follows the border set of the connected set.
See also:
getConnectedSetBorderContoursThreshold

Definition at line 119 of file qvcontour.cpp.

Referenced by getMSERContours().

QList< QVPolyline > qvdta::getLineContoursThreshold4Connectivity ( const QVImage< uChar > &  image,
const uChar  threshold = 128 
)

Obtains a list of the 4-connected contour lines in the image.

A contour is a sequence of pixels from an image, were every two contiguous pixels in the sequence are neighbours in the image.

This function can be used to obtain the 4-connected sets depicted in a border response image, obtained with Canny operator, or other image border response algorithm. It will return the contours as a qvdta::QVPolyline. Pixels with gray-level higher than threshold, will be considered as border pixels. An example of the contours obtained is depicted in the next image:

contours4connected.png

Circles indicate the first of the pixels in each set, and following pixels are joined with a continuous line, until the last of the pixels in the set, depicted with an asterisk. Ambiguous situations (such as pixels with more than two 4-connected neihgbour pixels) return unpredictable joining results.

Parameters:
image image from were to obtain the poly-lines.
threshold threshold to test if a pixel is considered a border or not.
Returns:
the list of contours (as qvdta::QVPolyline) in the image.
See also:
qvipp::Canny

Definition at line 237 of file qvcontour.cpp.

QList< QVPolyline > qvdta::getLineContoursThreshold8Connectivity ( const QVImage< uChar > &  image,
const uChar  threshold = 128 
)

Obtains a list of the 8-connected contour lines in the image.

A contour is a sequence of pixels from an image, were every two contiguous pixels in the sequence are neighbours in the image.

This function can be used to obtain the 8-connected sets depicted in a border response image, obtained with Canny operator, or other image border response algorithm. It will return the contours as a qvdta::QVPolyline. Pixels with gray-level higher than threshold, will be considered as border pixels. An example of the contours obtained is depicted in the next image:

contours8connected.png

Circles indicate the first of the pixels in each set, and following pixels are joined with a continuous line, until the last of the pixels in the set, depicted with an asterisk. Ambiguous situations (such as pixels with more than two 8-connected neihgbour pixels) return unpredictable joining results.

Parameters:
image image from were to obtain the poly-lines.
threshold threshold to test if a pixel is considered a border or not.
Returns:
the list of contours (as qvdta::QVPolyline) in the image.
See also:
qvipp::Canny

Definition at line 360 of file qvcontour.cpp.

void qvdta::getMSER ( const QVImage< uChar, 1 > &  image,
QList< QVMSER > &  MSERList,
const int  delta,
const int  minArea,
const int  maxArea,
const double  diffAreaThreshold 
)

This algorithm obtains MSER's - from an image.

This is an implementation of the MSER algorithm (see [Matas]. It does clustering of the MSER found in each node, keeping just the one with lowest q value. Also, small or large MSER are cleaned up using minimal and maximal areas permitted.

REFERENCES:

Definition at line 45 of file qvmser.cpp.

References qvdta::QVComponentTree::area(), qvdta::QVComponentTree::firstThreshold(), qvdta::QVComponentTree::getNumNodes(), qvdta::QVComponentTree::lastThreshold(), PROPORTIONAL_DISTANCE, qvdta::QVComponentTree::seedX(), and qvdta::QVComponentTree::seedY().

void qvdta::getMSERContours ( const QVImage< uChar, 1 > &  image,
const QList< QVMSER > &  MSERList,
QList< qvdta::QVPolyline > &  polylineMSERList 
)

Obtains border contours for an MSER list, obtained with the function getMSER.

Parameters:
image image to obtain border contours of MSER. Should be the same used with the function getMSER, if that was the one used to obtain MSER list.
MSERList list of MSER. It generally will be obtain using the function getMSER.
polylineMSERList list of border contours, represented as QVPolyline objects.
See also:
getMSER

Definition at line 29 of file qvmser.cpp.

References QVImage< Type, Channels >::getCols(), getConnectedSetBorderContourThreshold(), and QVImage< Type, Channels >::getRows().

void qvdta::IterativePointElimination ( const QVPolyline &  polyline,
QVPolyline &  result,
const double  minArea 
)

Simplifies a contour eliminating points of little area using IPE algorithm.

This function eliminate points of a QVPolyline, simplificating it. Points are eliminated if the area of the triangle formed with their two inmediate neighbours is smaller than a given minimum value.

Parameters:
polyline polyline to simplify.
result will store resulting simplified polyline.
minArea minimal area for the triangle formed with the neighbours of a point to eliminate it.

Definition at line 45 of file qvpolyline.cpp.

References qvdta::QVPolyline::closed, qvdta::QVPolyline::direction, and TRIANGLE_AREA.


Generated on Wed Jan 16 18:41:29 2008 for QVision by  doxygen 1.5.3