改变图像对比度和亮度.docx
文本预览下载声明
西安工业大学OpenCV实验报告 学 号: 101001116 姓 名: 王兵 指导老师:刘 建 伟 完成时间:2013/9/11 改变图像的对比度和亮度实验目标 :? 访问像素值?用0初始化矩阵?学习 saturate cast实验原理 :对图片中每个像素点的值进行变换,其变换公式为: g(i,j) = contrast*f(i,j)+brightness. 其中g(i,j)为变换后第i行第j列像素点值,f(i,j)为变换前对应点的值。实验环境:Opencv:2.3.1版本 Microsoft Visual Studio 2008(简称:vs2008)OS:WinXP位系统。实验步骤:新建工程,命名为:addTwoImages.编写代码(参考附录中的源代码)选择Solution Explorer 里的opencvhello项目,点击鼠标右键,选Properties :在[链接器 LINKER]的[输入 INPUT]中,为项目的Debug 配置增加 [ 附加依赖项 Additional Dependencies]: opencv_calib3d231d.lib opencv_contrib231d.lib opencv_core231d.lib opencv_features2d231d.lib opencv_flann231d.lib opencv_gpu231d.lib opencv_highgui231d.lib; opencv_imgproc231d.lib opencv_legacy231d.libopencv_ml231d.lib opencv_objdetect231d.lib opencv_ts231d.lib opencv_video231d.lib 单击,右键项目名称:按Rebuild。如果在控制台出现如下代码则程序正确,通过调试。1------ Rebuild All started: Project: twoImages, Configuration: Debug Win32 ------1Deleting intermediate and output files for project twoImages, configuration Debug|Win321Compiling...1stdafx.cpp1Compiling...1twoImages.cpp1d:\opcv\opencv\build\my\install\include\opencv2\flann\logger.h(66) : warning C4996: fopen: This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1 d:\vs2008\vc\include\stdio.h(237) : see declaration of fopen1d:\opcv\opencv\build\my\install\include\opencv2\flann\flann.hpp(233) : warning C4996: cv::flann::Index_T: was declared deprecated1 d:\opcv\opencv\build\my\install\include\opencv2\flann\flann.hpp(278) : see reference to class template instantiation cv::flann::Index_T being compiled1Compiling manifest to resources...1Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.01Copyright (C) Microsoft Corporation. All rights reserved.1Linking...1LINK : D:\vsproject\twoImages\Debug\twoImages.exe not found or not built by the last incremental link; performing full
显示全部