W7Computer visionCOMP90086 · Visual workbook
Step 1 of 28
02 / Find lines
Find lines · 1 of 4

Describe a line with two numbers

Start with one edge pixel, P = (4, 3). Many different lines can pass through it.

Worked example · same pixel, three lines

Choose a direction. Find its distance.

θ is the angle of the perpendicular, measured from +x. ρ is the distance from the origin along it.

1 · Draw the line through P
candidate line perpendicular

2 · Substitute x = 4 and y = 3

The line is

3 · Record one vote“P could belong to this line.”

A vote = one pixel supporting one possible line. Next, repeat this calculation for many angles.

Why not use slope, y = mx + b?

A horizontal line is easy: y = 3 has m = 0. A vertical line, x = 4, has no finite slope.

$$\theta=0^\circ\quad\Rightarrow\quad\rho=x\quad\Rightarrow\quad x=4$$

The perpendicular form handles both. Use 0° ≤ θ < 180° and a signed ρ; a negative ρ points opposite the chosen normal.

Visual derivation · P = (4, 3) · θ = 45°

ρ is the sum of two projections

Walk 4 right, then 3 down. How far does each move reach along the normal?