XX工业大学
OpenCV实验报告
学号:101001116
姓名:王兵
指导老师:X建伟
完成时间:2013/9/11
改变图像的对比度和亮度
一、实验目标:
•访问像素值
•用。初始化矩阵
•学习 saturate cast
二、实验原理:
对图片中每个像素点的值进行变换,其变换公式为:
g(i,j) = contrast*f(i,j)+brightness.
其中g(i,j)为变换后第i行第j列像素点值,为变换前对应点的
值。
三、实验环境:
Opencv: 版本 Microsoft Visual Studio 2008 (简称:vs2008)
OS: WinXP位系统。
四、实验步骤:
.新建工程,命名为:addTwoImages.
.编写代码(参考附录中的源代码)
.选择Solution Explorer里的opencvhello项目,点击鼠标右键,选 Properties :在[器LINKER]的[输入INPUT]中,为项目的Debug配置增 力口 [附加依赖项 Additional Dependencies]:
opencv_contrib23 opencv_core231
opencv_features2d23 opencv_flann231 opencv_gpu231
opencv_higligiii23 ; opencv_ts23
opencv_video23
.单击,右键项目名称:按Rebuild。如果在控制台出现如下代码则程序正 确,通过调试。
1> Rebuild All started: Project: twolmages, Configuration: Debug Win32
l>Delcting intermediate and output files for project 'twolmagcs*, configuration Debug | Win32,
l>piling...
l>
l>piling...
1 >
l>d:\opcv\opencv\build\my\install\include\opencv2\flann\(66) : warning C4996: 'fopen*: This function or variable may be unsafe. Consider using instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> d:\vs2008\vc\include\(237) : see declaration of 'fopen,
l>d:\opc
改变图像的对比度和亮度 来自淘豆网m.daumloan.com转载请标明出处.