Qu

line

Builtin index · Images

result = line(length, angle_degrees)

Input: length, angle_degrees · Output: result

What it is

length is a positive integer, the SE's length in pixels; angle_degrees is a number, the line's orientation (0 = along +x, positive = counterclockwise as displayed, same convention as imrotate). Builds a line-segment structuring-element mask Image by Bresenham-rasterizing a length-pixel segment centered on its own middle pixel. length <= 1 degenerates to a single center pixel.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = line(length, angle_degrees)
length —length is a positive integer, the SE's length in pixels.
angle_degrees numberangle_degrees is a number, the line's orientation (0 = along +x, positive = counterclockwise as displayed, same convention as imrotate).
result Image
Returns a new binary Image, sized to the line's own bounding box. Added in v0.4.0.

Examples

No documentation example calls this form yet. The Images chapter is where one belongs.