oreillymedia/Learning-OpenCV-3_examples

example_15-04.cpp

hongry18 opened this issue · 0 comments

my enviroment mac os mojave 10.14

updateCodebook(cv::Vec<unsigned char, 3> const&, CodeBook&, int*, int) + 117 (ex-15.4.cpp:67)

segmentation fault: 11

for (n = 0; n<numChannels; n++) {
        high[n] = p[n] + *(cbBounds+n); // segmentation fault 11 point
        if ( high[n] > 255 ) {
            high[n] = 255;
        }

        low[n] = p[n] - *(cbBounds+n);
        if ( low[n] < 0 ) {
            low[n] = 0;
        }
    }