#include "imageproc.h"
#include "linalg.h"
Go to the source code of this file.
Functions | |
Array * | bresenham_line (int start[2], int end[2]) |
Bresenhams Line-drawing-algorithm. | |
Array * | bresenham_linesegments (const Array *points) |
Connected line-segments with bresenhams Line-drawing-algorithm. | |
Array * | disttransform_deadreckoning (const Array *in, Array *dt) |
calculate the (signed) distance-transform of a binary image. |
Array* bresenham_line | ( | int | start[2], | |
int | end[2] | |||
) |
Bresenhams Line-drawing-algorithm.
(stolen and modified from Wikipedia)
start | coordinates of starting point | |
end | coordinates of last point |
Definition at line 237 of file imageproc.c.
Connected line-segments with bresenhams Line-drawing-algorithm.
Calls bresenham_line() for each pair of points.
Example:
points | 2xM INT-array containig coordinates points through which the line-segments should lead |
Definition at line 197 of file imageproc.c.
calculate the (signed) distance-transform of a binary image.
This distance-transform (DT) of a binary image includes at each pixel the shortest distance to the closest nonzero point in the input image.
Example (left is the binary matrix, right the DT; in the upper right corner is another white pixel):
This implementation uses the dead-reckoning algorithm from
@article{grevera2004dead, title={{The" Dead reckoning" signed distance transform}}, author={Grevera, G.J.}, journal={Computer Vision and Image Understanding}, volume={95}, number={3}, pages={317--333}, year={2004} }
in | INT-array representing a binary image | |
dt | DOUBLE-array of same dimensions as in, or NULL (alloc in function) |
Definition at line 51 of file imageproc.c.