Classes | |
class | QVComponentTree |
Image component tree data structure. More... | |
class | QVPolyline |
Polyline representation. More... | |
class | QVPolylineF |
Floating point polyline representation. More... | |
Functions | |
double | IterativePointElimination (const QVPolyline &polyline, QVPolyline &result, const double param, bool maxNumberOfPointsMethod=FALSE, bool intersectLines=TRUE, double *max_removed_cost=NULL) |
Simplifies a contour eliminating points of little area using IPE algorithm. | |
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< QVPolyline > | 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. | |
QList< QVPolyline > | getLineContoursThreshold4Connectivity (const QVImage< uChar > &image, const uChar threshold=128) |
Obtains a list of the 4-connected contour lines in the image. | |
QList< QVPolyline > | getLineContoursThreshold8Connectivity (const QVImage< uChar > &image, const uChar threshold=128) |
Obtains a list of the 8-connected contour lines in the image. | |
double | IterativePointElimination (const QVPolylineF &polyline, QVPolylineF &result, const double param, bool maxNumberOfPointsMethod=FALSE, bool intersectLines=TRUE, double *max_removed_cost=NULL) |
Simplifies a contour eliminating points of little area using IPE algorithm. |
See Wikipedia's description for image features for a description.
QList<QVPolyline> 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:
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.
image | image from were to obtain the poly-lines. | |
threshold | threshold to consider pixels inside or outside the connected sets. |
Definition at line 542 of file qvpolyline.cpp.
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.
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 automaton, 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.
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. |
Definition at line 522 of file qvpolyline.cpp.
QList<QVPolyline> 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 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:
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.
image | image from were to obtain the poly-lines. | |
threshold | threshold to test if a pixel is considered a border or not. |
Definition at line 653 of file qvpolyline.cpp.
QList<QVPolyline> 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 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:
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.
image | image from were to obtain the poly-lines. | |
threshold | threshold to test if a pixel is considered a border or not. |
Definition at line 776 of file qvpolyline.cpp.
double IterativePointElimination | ( | const QVPolylineF & | polyline, | |
QVPolylineF & | result, | |||
const double | param, | |||
bool | maxNumberOfPointsMethod = FALSE , |
|||
bool | intersectLines = TRUE , |
|||
double * | max_removed_cost = NULL | |||
) |
Simplifies a contour eliminating points of little area using IPE algorithm.
This function eliminates points of a QVPolylineF, simplificating it. Points are recursively eliminated while a) their distance to the line joining its two immediate neighbours is smaller than a given maximum value, or b) the number of points of the approximated polyline falls below a given number (depending on the chosen method).
The return value (which indicates the cost of the first not deleted point) and the optional parameter max_removed_cost are useful to estimate a measure of how well the polyline approximation did. A good approximation will have (relative) low max_removed_cost/return_cost ratio, and (absolute) low max_removed_cost value.
polyline | polyline to simplify. | |
result | will store resulting simplified polyline. | |
param | maximal distance for a point to eliminate it, if maxNumberOfPointsMethod is FALSE, or maximal number of points in the result polyline, if maxNumberOfPointsMethod is TRUE. | |
maxNumberOfPointsMethod | if TRUE, the procedure ends when the number of points of the resulting polyline is lesser or equal to param. If FALSE, the procedure ends when there are no more points with distance to line given by its neighbours smaller than param. | |
intersectLines | If TRUE, a post-processing stage adjusts final points using all the deleted points among vertexs to fit straight lines, whose intersection by pairs gives the final points (recommended for greater precision, at a minimal additional cost). | |
max_removed_cost | If not NULL, pointer to a float value that the procedure will fill with the maximum cost (distance to corresponding line) of all the removed points. |
Definition at line 76 of file qvpolylinef.cpp.
double IterativePointElimination | ( | const QVPolyline & | polyline, | |
QVPolyline & | result, | |||
const double | param, | |||
bool | maxNumberOfPointsMethod = FALSE , |
|||
bool | intersectLines = TRUE , |
|||
double * | max_removed_cost = NULL | |||
) |
Simplifies a contour eliminating points of little area using IPE algorithm.
This function eliminates points of a QVPolyline, simplificating it. Points are recursively eliminated while a) their distance to the line joining its two immediate neighbours is smaller than a given maximum value, or b) the number of points of the approximated polyline falls below a given number (depending on the chosen method).
The return value (which indicates the cost of the first not deleted point) and the optional parameter max_removed_cost are useful to estimate a measure of how well the polyline approximation did. A good approximation will have (relative) low max_removed_cost/return_cost ratio, and (absolute) low max_removed_cost value.
polyline | polyline to simplify. | |
result | will store resulting simplified polyline. | |
param | maximal distance for a point to eliminate it, if maxNumberOfPointsMethod is FALSE, or maximal number of points in the result polyline, if maxNumberOfPointsMethod is TRUE. | |
maxNumberOfPointsMethod | if TRUE, the procedure ends when the number of points of the resulting polyline is lesser or equal to param. If FALSE, the procedure ends when there are no more points with distance to line given by its neighbours smaller than param. | |
intersectLines | If TRUE, a post-processing stage adjusts final points using all the deleted points among vertexs to fit straight lines, whose intersection by pairs gives the final points (recommended for greater precision, at a minimal additional cost). | |
max_removed_cost | If not NULL, pointer to a float value that the procedure will fill with the maximum cost (distance to corresponding line) of all the removed points. |
Definition at line 76 of file qvpolyline.cpp.