Histogram-based stereo matching under varying illumination conditions