Segment-tree based cost aggregation for stereo matching with enhanced segmentation