Comparing image blocks by training stereo matching convolutional neural networks