(10)图像增强 |
您所在的位置:网站首页 › 增加曝光和增加亮度哪个好用 › (10)图像增强 |
目标
在本教程中,您将学习如何: 访问像素值用零初始化矩阵了解cv :: saturate_cast的作用以及它有用的原因获取有关像素转换的一些很酷的信息在实际例子中提高图像的亮度 理论注意,以下解释属于Richard Szeliski 所着的Computer Vision:Algorithms and Applications一书 图像处理 一般图像处理操作符是获取一个或多个输入图像并产生输出图像的功能。图像变换可以看作: 点运算(像素变换)-Point operators (pixel transforms)邻域操作Neighborhood (area-based) operators 像素转换 在这种图像处理变换中,每个输出像素的值仅取决于相应的输入像素值。这种算子的例子包括亮度和对比度调整以及颜色校正和变换。 亮度和对比度调整两个常用的点过程是乘法和加法与常量: 假设f(x)作为源图像像素,g(x)作为输出图像像素,上述表达式可以改写为: 其中,i和j表示像素位于第i行和第j列。 Coding C ++ 完整代码: /** * @file BasicLinearTransforms.cpp * @brief Simple program to change contrast and brightness * @author OpenCV team */ #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include // we're NOT "using namespace std;" here, to avoid collisions between the beta variable and std::beta in c++17 using std::cin; using std::cout; using std::endl; using namespace cv; /** * @function main * @brief Main function */ int main( int argc, char** argv ) { /// Read image given by user //! [basic-linear-transform-load] CommandLineParser parser( argc, argv, "{@input | ../data/lena.jpg | input image}" ); Mat image = imread( parser.get( "@input" ) ); if( image.empty() ) { cout |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |