jzbontar / mc-cnn

Stereo Matching by Training a Convolutional Neural Network to Compare Image Patches
BSD 2-Clause "Simplified" License
707 stars 232 forks source link

problem about function sgm2 in adcensus.cu #18

Closed Sarah20187 closed 7 years ago

Sarah20187 commented 7 years ago

near line 579, the code as follows:


for (int i = 256; i > 0; i /= 2) {
        if (d < i && d + i < size3 && output_min[d + i] < output_min[d]) {
            output_min[d] = output_min[d + i];
        }
        __syncthreads();
    }

Should the initial number of i to be the max disparity here?

jzbontar commented 7 years ago

I haven't looked at this code for awhile, but it looks correct. I think i should be set to the largest power of two that is smaller than the highest max_disparity. I believe the highest max_disparity is 400 for some Middlebury samples, so setting i to 256 seems okay.

Sarah20187 commented 7 years ago

Thank you!