OpenCV——staturate_cast、掩模操作

saturate_cast<>()模板函数,用于溢出保护

1 //大致的原理如下
2 if(data<0) 
3         data=0; 
4 elseif(data>255) 
5     data=255;

掩模操作:https://blog.csdn.net/qq_25343557/article/details/78654011

原文地址:https://www.cnblogs.com/long5683/p/9655934.html