|
pink26 0.1.1
Image processing and digital topology for teaching
|
End points, curve points and junction points of a binary image. More...
Go to the source code of this file.
Functions | |
| p26_status | p26_end_points (const p26_image *binary, int connectivity, p26_image **out) |
| Selects the end points: the object points with exactly 1 object neighbor in the chosen connectivity (Pink's lptend). | |
| p26_status | p26_curve_points (const p26_image *binary, int connectivity, p26_image **out) |
| Selects the curve points: the object points p with T(p) = 2 and exactly 2 object neighbors in the chosen connectivity (Pink's lptcurve). | |
| p26_status | p26_junction_points (const p26_image *binary, int connectivity, p26_image **out) |
| Selects the junction points: the object points with at least 3 object neighbors in the chosen connectivity (Pink's lptjunction). | |
End points, curve points and junction points of a binary image.
These three selectors read the shape of a thin object, such as a skeleton (pink26/skeleton.h, pink26/parallel_skeleton.h): where its branches end, where it is a simple curve, and where several branches meet. They are Pink's point selectors (lseltopo.c), unchanged. Each one looks only at the object neighbors of a point, in the chosen connectivity n: the 4 or 8 neighbors in 2D, the 6 or 26 neighbors in 3D.
Definitions (Pink's, in plain words), for an object point p:
Two meanings of "junction". Here a junction only counts neighbors. That count makes sense on a thin skeleton only: on a thick object nearly every point is a junction in this sense (in a full 3 x 3 square, with n = 8, all 9 points are: a corner has 3 object neighbors, a side point 5, the center 8). Even on a thin skeleton, the meeting point of branches can count several junction points: with n = 8, when two branches leave it through two sides of the pixel (4-neighbors) that share a corner, their first points touch each other by a corner and have 3 object neighbors too. The classification of Malandain, Bertrand and Ayache (p26_point_classes_3d() in pink26/topology.h) reads a junction on the topological numbers T and T-bar instead: it is a topological notion, which holds on thick objects as well as on thin ones.
Border convention: as everywhere in pink26, the image is surrounded by an infinite background, so a point on the side of the image is selected like any other point (a line that crosses the image has its two extreme points as end points). Pink's selectors never select a point of the border of their image: pink26 gives them a copy with a frame of 1 pixel of background on each side, along z too in 3D. A 3D image of a single plane, of shape (1, H, W), is therefore a 3D object one voxel thick.
Pink functions used (lseltopo.c; Couprie, ESIEE). The neighbor counts are nbvois4 / nbvois8 (mctopo.c) and mctopo3d_nbvoiso6 / mctopo3d_nbvoiso26 (mctopo3d.c):
pink26 function Pink 2D (n = 4 / 8) 3D (n = 6 / 26)
p26_end_points() lptend count = 1 count = 1
p26_curve_points() lptcurve curve4 / curve8 mctopo3d_curve6 /
mctopo3d_curve26
p26_junction_points() lptjunction count >= 3 count >= 3
curve4, curve8, mctopo3d_curve6 and mctopo3d_curve26 compute T with top4, top8, mctopo3d_T6 and mctopo3d_T26: the T of p26_topological_numbers().
Sizes: Pink indexes the pixels in int64 (index_t), so the only limits are those of p26_image and of the framed copy (P26_E_OVERFLOW if the image with its frame of 1 pixel has more than PTRDIFF_MAX pixels).
| p26_status p26_end_points | ( | const p26_image * | binary, |
| int | connectivity, | ||
| p26_image ** | out ) |
Selects the end points: the object points with exactly 1 object neighbor in the chosen connectivity (Pink's lptend).
| binary | P26_U8 image, 2D or 3D; any nonzero value is an object point. |
| connectivity | Connectivity of the object: 4 or 8 for a 2D image, 6 or 26 for a 3D image. It says which points are neighbors. |
| out | Set to NULL on entry; receives a new P26_U8 image of the shape of binary, 1 on the selected points and 0 elsewhere (released with p26_image_free()). |
Complexity: O(N) time for N pixels; memory: the framed copy (1 byte per pixel), Pink's result buffer of the same size, and the output.
| p26_status p26_curve_points | ( | const p26_image * | binary, |
| int | connectivity, | ||
| p26_image ** | out ) |
Selects the curve points: the object points p with T(p) = 2 and exactly 2 object neighbors in the chosen connectivity (Pink's lptcurve).
With 8 or 26, p lies between exactly two points of a thin curve; with 4 or 6, a diagonal point may join one of the two components (see the top of this file).
| binary | As p26_end_points(). |
| connectivity | As p26_end_points(); T(p) is computed for this connectivity of the object (pink26/topology.h). |
| out | As p26_end_points(). |
Complexity: as p26_end_points().
| p26_status p26_junction_points | ( | const p26_image * | binary, |
| int | connectivity, | ||
| p26_image ** | out ) |
Selects the junction points: the object points with at least 3 object neighbors in the chosen connectivity (Pink's lptjunction).
This only counts neighbors: it describes a thin skeleton, not a thick object, where nearly every point has 3 neighbors or more. The topological junctions of [MBA93], read on T and T-bar, are the classes of p26_point_classes_3d() (pink26/topology.h); see "Two meanings of junction" at the top of this file.
| binary | As p26_end_points(). |
| connectivity | As p26_end_points(). |
| out | As p26_end_points(). |
Complexity: as p26_end_points().