draw_line_table#
- cbclib.bin.draw_line_table(lines: numpy.ndarray, shape: Optional[Tuple[int, int]] = None, dilation: float = 0.0, profile: str = 'gauss')[source]#
Return an array of rasterized thick lines indices and their corresponding pixel values. The lines are drawn with variable thickness and the antialiasing applied. The lines must follow the LSD convention, see the parameters for more info.
- Parameters
lines (numpy.ndarray) –
An array of the detected lines. Must have a shape of (N, 7), where N is the number of lines. Each line is comprised of 7 parameters as follows:
[x0, y0], [x1, y1] : The coordinates of the line’s ends.
width : Line’s width.
p : Angle precision [0, 1] given by angle tolerance over 180 degree.
-log10(NFA) : Number of false alarms.
shape (Optional[Tuple[int, int]]) – Shape of the image. All the lines outside the shape will be discarded.
max_val – Maximum pixel value of a drawn line.
dilation (float) – Size of the binary dilation applied to the output image.
profile (str) –
Line width profiles. The following keyword values are allowed:
tophat : Top-hat (rectangular) function profile.
linear : Linear (triangular) function profile.
quad : Quadratic (parabola) function profile.
gauss : Gaussian funtion profile.
- Raises
ValueError – If lines has an incompatible shape.
RuntimeError – If C backend exited with error.
- Returns
Output line indices.
- Return type
Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]
See also
cbclib.bin.LSD: Line Segment Detector.