Learning a confidence measure in the disparity domain from O(1) features