A method for detecting a road at night or in poor visual conditions, said method being based on an image frame and being executed by a computer, said image frame, I, being divided into pixels, each having an intensity value assigned corresponding to a temperature of a point of an environment that the image frame represents, said method comprising the steps of - calculating a mask of road candidate pixels, R, by detecting in said image frame pixels candidating to represent a road; - selecting from the road candidate pixels in the mask an initial cluster of road candidate pixels having a lower boundary coinciding with or being located in the vicinity of the lower part of the image frame as an estimate of the road; - determining a horizon estimate (H, 240) as a first horizontally oriented boundary between rows of the mask that are characterized by different densities of road candidate pixels in the mask by determining a first horizon estimate based on a vertical projection of the pixel values in the mask and determining a second horizon estimate based on a derivative of the vertical projection of the pixel values and determining the horizon estimate (H, 240) based on the first horizon estimate and the second horizon estimate; - defining a final road cluster by correcting the selected initial cluster of road candidate pixels having an upper boundary, said correction being based on the location of said upper boundary relative to the estimated horizon and a predetermined upper limit for the location of the horizon while erasing all road candidate pixels with a vertical component lower than the horizon estimate (H,240), wherein said detection of road candidate pixels is based on a calculation of a first upper temperature threshold, Th, from the pixel intensity values of said image frame, and wherein the road candidate pixels are detected by comparing each pixel intensity value to said first upper temperature threshold value, Th. - calculating a mask of road candidate pixels, R, by detecting in said image frame pixels candidating to represent a road; - selecting from the road candidate pixels in the mask an initial cluster of road candidate pixels having a lower boundary coinciding with or being located in the vicinity of the lower part of the image frame as an estimate of the road; - determining a horizon estimate (H, 240) as a first horizontally oriented boundary between rows of the mask that are characterized by different densities of road candidate pixels in the mask by determining a first horizon estimate based on a vertical projection of the pixel values in the mask and determining a second horizon estimate based on a derivative of the vertical projection of the pixel values and determining the horizon estimate (H, 240) based on the first horizon estimate and the second horizon estimate; - defining a final road cluster by correcting the selected initial cluster of road candidate pixels having an upper boundary, said correction being based on the location of said upper boundary relative to the estimated horizon and a predetermined upper limit for the location of the horizon while erasing all road candidate pixels with a vertical component lower than the horizon estimate (H,240), wherein said detection of road candidate pixels is based on a calculation of a first upper temperature threshold, Th, from the pixel intensity values of said image frame, and wherein the road candidate pixels are detected by comparing each pixel intensity value to said first upper temperature threshold value, Th.