Adaptive epipolar distance transform and adaptive matching cost for stereo matching