A computerized method for detection of a hazard in a road, the method performable by a driver assistance system mountable in a host vehicle and performable while the host vehicle is moving, wherein the driver assistance system includes a camera connected to a processor, the method including: capturing a first image frame and a second image frame from the field of view of the camera; tracking corresponding image points of the road from said first image frame to said second image frame; computing the optical flow of the corresponding image points of the road, obtaining a three-dimensional model of the road scene using a Structure-from-Motion algorithm, computing a model of the road plane, detecting objects protruding above the road plane as potential hazards; computing the residual image flow, the residual image flow being defined as the differences between the optical flow of road points and the optical flow of the modelled road plane, and hypothesizing that a potential hazard is a hypothetical static object on the road if its residual motion flow is not zero; projecting the bottom edge on the road plane of the hypothesized static object in the three-dimensional model onto the image frames; taking a patch containing the projected bottom edge; determining that the image motion is not caused by a static object on the road if the patch does not have a cluster of horizontal edge points contained in one or two adjacent rows or if the texture of hypothesized bottom edge of the static object is changing over the image frames, and confirming thereby that the image motion is caused by a moving shadow; or determining that the image motion is caused by a static object on the road if the patch has a cluster of horizontal edge points contained in one or two adjacent rows, and if the texture of the hypothesized bottom edge of the static object is fixed over the image frames, thereby verifying detection of a hazard in the road. capturing a first image frame and a second image frame from the field of view of the camera; tracking corresponding image points of the road from said first image frame to said second image frame; computing the optical flow of the corresponding image points of the road, obtaining a three-dimensional model of the road scene using a Structure-from-Motion algorithm, computing a model of the road plane, detecting objects protruding above the road plane as potential hazards; computing the residual image flow, the residual image flow being defined as the differences between the optical flow of road points and the optical flow of the modelled road plane, and hypothesizing that a potential hazard is a hypothetical static object on the road if its residual motion flow is not zero; projecting the bottom edge on the road plane of the hypothesized static object in the three-dimensional model onto the image frames; taking a patch containing the projected bottom edge; determining that the image motion is not caused by a static object on the road if the patch does not have a cluster of horizontal edge points contained in one or two adjacent rows or if the texture of hypothesized bottom edge of the static object is changing over the image frames, and confirming thereby that the image motion is caused by a moving shadow; or determining that the image motion is caused by a static object on the road if the patch has a cluster of horizontal edge points contained in one or two adjacent rows, and if the texture of the hypothesized bottom edge of the static object is fixed over the image frames, thereby verifying detection of a hazard in the road.