For example, an image processing apparatus for a vehicle (for example, see Japanese Patent Application Laid-Open No.  10-222679) and an obstacle detection system (for example, see International Publication No.  2007/142267) have been known in the past.  The image processing apparatus is configured to detect the amount of travel of a vehicle from the vehicle speed and the yaw rate in order to detect an obstacle using a background differencing technique.  The obstacle detection system is configured to detect the amount of travel of a vehicle by processing two camera images that have been taken at different times in order to detect an obstacle using a background differencing technique. 
Further, as for the measurement of the amount of travel of a vehicle, a technique has been known (for example, see Japanese Patent Application Laid-Open No.  2009-074861).  The technique is a travel amount measurement device configured to measure the amount of travel of a mobile object using a speed obtained based on a taken image and a speed obtained based on the vehicle speed sensor or the like.  In the device, when the number of the vehicle speed pulses is one or more, the amount of travel is calculated based on the vehicle speed pulse, and when the number of the vehicle speed pulses is zero, the amount of travel is calculated based on the taken image. 
The image processing apparatus for a vehicle disclosed in Japanese Patent Application Laid-Open No.  10-222679 detects, for example, the vehicle speed using the vehicle sensor and the yaw sensor.  There is a problem in that the error of the amount of travel of the vehicle is increased because the sensors have low sensitivities when the vehicle runs at low speed. 
The obstacle detection system disclosed in International Publication No.  2007/142267 has a problem in that an error in the amount of travel of the vehicle is increased because the accuracy of tracking the feature points included in the image is reduced when the image drastically changes while the vehicle runs at high speed. 
Using the technique for measuring the amount of travel disclosed in Japanese Patent Application Laid-Open No.  2009-074861 can solves the problems.  In other words, using the amount of travel of the vehicle calculated based on the image when the vehicle runs at low speed and using the amount of travel of the vehicle detected by the vehicle speed sensor or the like when the vehicle runs at high speed can reduce the error at each of the speed ranges. 
By the way, to detect an obstacle, the techniques disclosed in Japanese Patent Application Laid-Open No.  10-222679 and International Publication No.  2007/142267 extract the obstacle by comparing an estimated image with the currently-taken image.  The estimated image is obtained by moving the vehicle in the past image by the obtained amount of travel of the vehicle.  Thus, when the timing when the past image has been taken differs from the timing when the amount of travel of the vehicle has been detected by the vehicle speed sensor or the like, the estimated image includes the error caused by the difference.  This causes an error in the obstacle detection. 
When it is considered that the amount of travel of a vehicle is calculated based on the image taken by the camera that is actually mounted on the vehicle (this image is also used for calculating an estimated image.),  and the amount of travel of a vehicle is also detected using the vehicle speed sensor or the like, the timing when the amount is calculated and the timing when the amount is detected do not necessarily correspond to each other.  For example, on the assumption that 7.5 frames of the taken images can obtained per second (7.5 fps), the interval of the calculation of the amount of travel of the vehicle based on the taken image is 133 ms.  On the other hand, on the assumption that the timing of the detection by the vehicle sensor or the like is 100 ms, both of the timings are almost always out of synchronization with each other and the amount of the gap changes from moment to moment.  Further, on the assumption that the value detected by the vehicle speed sensor or the like is input through a controller area network (CAN), the precise time when the detected value has been obtained through the CAN cannot be found. 
In other words, as disclosed in Japanese Patent Application Laid-Open No.  2009-074861, a mere switch according to the speed range between the calculation of the amount of travel of the vehicle by the image and the detection of the amount of travel of the vehicle by the vehicle speed sensor or the like cannot solve the problem in that the error included in the amount of travel of the vehicle with respect to the taken image is increased.  Thus, there is a problem in that the accuracy of detecting an obstacle is reduced.