saturate_cast防越界函数

CV_IMAGE_ELEM(img2,uchar,i,j*3+c)=saturate_cast<uchar>(alpha*( CV_IMAGE_ELEM(img,uchar,i,j*3+c) ) + beta );

图像的点操作,防止越界,一般都是这个做法。

posted @ 2017-02-23 16:55  体育.委员  阅读(1465)  评论(0编辑  收藏  举报