0
$\begingroup$

For line detection with Hough transform a line equation in Cartesian coordinates

y = m⋅x + b (1)

is transformed to polar coordinates to become:

p = x⋅cos(θ) + y⋅sin(θ) (2)

I'm trying to prove (2) from (1), but keep on getting

p = -x⋅cos(θ) + y⋅sin(θ) (2)

I attached my derivation below:

Derivation

Can anyone point me to where am I making a mistake?

  • 0
    check your expression for "m" with particular attention to the sign2017-01-20
  • 0
    @DavidHolden I appreciate that flipping sign on it I would get expected result, but don't see why that should be done. Slope of a line is defined by `Δy/Δx`, not `-Δy/Δx`2017-01-20
  • 0
    yes but Δx is negative! think about the definition of the slope of a line2017-01-20
  • 0
    $\sin\theta = \frac{\rho}{\Delta y}$ is incorrect, since the length of a hypotenuse should be positive, but here $\Delta y < 0$. You should have $\sin\theta = \frac{\rho}{- \Delta y}$.2017-01-20
  • 0
    @DavidHolden Ah, now I finally get it. Slope is a change of y during change in x. From 0 to x, or change Δx, y changed by -Δy. Thank you, a feel really silly now.2017-01-20
  • 0
    don't feel silly, it was an easy mistake to make, and having made it, the conclusion seems so logical that it is then difficult to find the flaw in the line of reasoning.2017-01-20

1 Answers 1

0

As hinted by David Holden, sign of my slope equation was wrong, since during change of Δx, y changed by -Δy, not +Δy.