0
$\begingroup$

The straight line $y=mx+b$ can be expressed in polar coordinates as:

$$\rho=x\cos(\theta) + y\sin(\theta)$$

Where $(\rho,\theta)$ defines a vector from the origin to the nearest point on the line. Thus the Hough transform of a straight line in $x-y$ space is a point in $(\rho,\theta)$ space.

Find $(\rho, \theta)$ for the following straight line $y=-x+5$.


I'm trying to go through a simple exercise for the Hough transform where I have a simple straight line in the form of $\;y=-x+5\;$ and I want to obtain polar coordinates $\;(\rho,\theta)$. I know polar coordinates can be represented by $\;\rho = x⋅\cos(\theta) + y⋅\sin(\theta).$

What are the steps I'm supposed to take to solve this problem? I have searched around and couldn't really find any examples I can follow in this exact format.

$\endgroup$
  • $\begingroup$ Are you sure that’s what $p$ is supposed to be? $\endgroup$ – amd Nov 30 '18 at 20:15
  • $\begingroup$ thats just the format, it says a equation that is y=mx+b can be expressed in polar coordinates like that equation. it says the hough transform of a line turns into a point and I need to find the point in (p,θ) space $\endgroup$ – dshawn Nov 30 '18 at 23:02
  • 2
    $\begingroup$ "I know polar coordinates can be represented by p=x⋅cos(θ)+y⋅sin(θ)": er, no. $\endgroup$ – Yves Daoust Nov 30 '18 at 23:16
  • $\begingroup$ Well the issue is this equation is given to me by the question, so I don't know am I misreading the question? I know the p is a greek letter and not a normal p. I will post the full question just in case $\endgroup$ – dshawn Dec 1 '18 at 1:57
0
$\begingroup$

After the definition of the Hough transform is

  • $\rho$ equal to the distance of the origin to the line. The nearest point on the line (to the origin) is $\;P=\left(\frac{5}{2},\frac{5}{2}\right)\;$ so $\rho=\frac{5\sqrt 2}{2}.$

  • $\theta=\frac \pi4\;$ is the angle between $x-$ axis and $OA.$

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

Using polar coordinates, a line is represented as

$$ax+by+c=a\rho\cos\theta+b\rho\sin\theta+c=0$$

or

$$\rho=-\frac c{a\cos\theta+b\sin\theta}.$$


With $\theta_0:=\tan\dfrac ba$ and $p:=-\dfrac c{\sqrt{a^2+b^2}}$, it can be rewritten

$$\rho=\frac p{\cos(\theta-\theta_0)},$$

where $\theta_0$ is the direction of the normal to the line, and $p$ the distance from the line to the origin.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

You can write any point $(x,y)$ on the line as $(r\cos \theta, r\sin \theta)$, where $r = \sqrt{x^2+y^2}$ and $\theta = \tan^{-1}(y/x)$.

For example, consider the point $(4,3)$, which is on the line. You have $r = \sqrt{4^2+3^2} = 5$ and $\theta = \tan^{-1}(3/4) = 0.6435$. This gives $\cos \theta = 0.8$ and $\sin \theta = 0.6$. You can see that $x = r \cos \theta$ and $y = r \sin \theta$.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ is it $\tan ^{-1}?$ $\endgroup$ – user376343 Dec 1 '18 at 20:58
  • $\begingroup$ @user376343 Yes, fixed it. Thanks, $\endgroup$ – Aditya Dua Dec 2 '18 at 3:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.