A straight line detection apparatus (1, 1A-1D) comprising: a Hough transform part configured to convert a straight line that passes through an arbitrary point in a specified image to a value set of coordinates (θ,ρ) in a Hough space by representing an arbitrary straight line in the specified image using a length p of a perpendicular extending from a reference point of the specified image to the arbitrary straight line in the specified image and an angle θ formed by the perpendicular with a reference axis that passes through the reference point; a counting part configured to count a number of conversions by the Hough transform part for each value set of coordinates (θ,ρ) in the Hough space; an adjustment part configured to obtain an adjusted count Tc[θ][ρ] by adjusting a count T[θ][ρ] for each value set of coordinates (θ,ρ) by means of weighting depending on at least one of ρ and θ; and a detection part configured to detect the straight line in the specified image by identifying a value set of coordinates (θ,ρ) for which the adjusted count Tc[θ][ρ] exceeds a first threshold, wherein the adjustment part is configured to adjust the count T[θ][ρ] for each value set of coordinates (θ,ρ) by using a first weighting function which takes ρ as an input and outputs a first adjustment factor f(ρ) and/or a second weighting function which takes θ as an input and outputs a second adjustment factor g(θ), to obtain the adjusted count Tc[θ][ρ] according to one of the following equations: Tc θ ρ = T θ ρ Len × f ρ, Tc θ ρ = T θ ρ Len × g θ, Tc θ ρ = T θ ρ × f ρ × g θ, wherein f ρ = c − b a 4 ρ 4 − 2 c − b a 2 ρ 2 + c, and g θ = { = e 0 ≤ θ < d − s = k − e s 4 θ − d 4 − 2 k − e s 2 θ − d 2 + k d − s ≤ θ < d + s = e d + s ≤ θ < π < d − s = k − e s 4 θ − d 4 − 2 k − e s 2 θ − d 2 + k π − d − s ≤ θ < π − d + s = e π − d + s ≤ θ < π with given constants a, b, c, d, s, e and k. a Hough transform part configured to convert a straight line that passes through an arbitrary point in a specified image to a value set of coordinates (θ,ρ) in a Hough space by representing an arbitrary straight line in the specified image using a length p of a perpendicular extending from a reference point of the specified image to the arbitrary straight line in the specified image and an angle θ formed by the perpendicular with a reference axis that passes through the reference point; a counting part configured to count a number of conversions by the Hough transform part for each value set of coordinates (θ,ρ) in the Hough space; an adjustment part configured to obtain an adjusted count Tc[θ][ρ] by adjusting a count T[θ][ρ] for each value set of coordinates (θ,ρ) by means of weighting depending on at least one of ρ and θ; and a detection part configured to detect the straight line in the specified image by identifying a value set of coordinates (θ,ρ) for which the adjusted count Tc[θ][ρ] exceeds a first threshold, wherein the adjustment part is configured to adjust the count T[θ][ρ] for each value set of coordinates (θ,ρ) by using a first weighting function which takes ρ as an input and outputs a first adjustment factor f(ρ) and/or a second weighting function which takes θ as an input and outputs a second adjustment factor g(θ), to obtain the adjusted count Tc[θ][ρ] according to one of the following equations: Tc θ ρ = T θ ρ Len × f ρ, Tc θ ρ = T θ ρ Len × g θ, Tc θ ρ = T θ ρ × f ρ × g θ, wherein f ρ = c − b a 4 ρ 4 − 2 c − b a 2 ρ 2 + c, and g θ = { = e 0 ≤ θ < d − s = k − e s 4 θ − d 4 − 2 k − e s 2 θ − d 2 + k d − s ≤ θ < d + s = e d + s ≤ θ < π < d − s = k − e s 4 θ − d 4 − 2 k − e s 2 θ − d 2 + k π − d − s ≤ θ < π − d + s = e π − d + s ≤ θ < π with given constants a, b, c, d, s, e and k.