资源简介
RemoveHaze.rar

代码片段和文件信息
// DarkDlg.cpp : implementation file
//
#include “stdafx.h“
#include
#include “time.h“
#include
#include “resource.h“ // main symbols
#include “DarkChannelPrior.h“
#include
#include
using namespace std;
#define for if (false); else for
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
int cmp( const int &a const int &b ){
if( a > b )
return 1;
else
return 0;
}
CDarkChannelPrior::CDarkChannelPrior() // standard constructor
{
}
CDarkChannelPrior::~CDarkChannelPrior() // standard constructor
{
}
/****************************************************************************************
*
* 函数名称:
* Process()
*
* 参数:
* IplImage *pImage - 要处理的图像的指针
*
* 返回值
* IplImage* - 成功返回IplImage*指针。
*
* 说明:
* 该函数对原图像进行基于暗原色先验的图像去雾处理,并将结果存储一个IplImage*对象中。
*
*****************************************************************************************/
IplImage* CDarkChannelPrior::Process(IplImage *pImage)
{
blockSize = 15;
w0 = 0.95;
t0=0.4;
clock_t start finish;
start = clock(); //程序运行起始时间
CvMat *darkImage = NULL;
double airlight = 0.0;
CvMat *Mat = NULL;
CvMat *mat = NULL;
IplImage *resImage = NULL;
if (pImage->nChannels == 1)
{
darkImage = GetSingleDarkChannel(pImage blockSize); //获得dark channel图
airlight = GetAirLight(darkImage); //获得大气光Airlight
Mat = GetT(darkImage w0 airlight); //计算transmission
mat = guidedfilter(pImage Mat 20 0.001);
resImage = GetResultGrayImage(pImage mat airlight t0); //获得修正t后的去雾图像
}
else
{
darkImage = GetDarkChannel(pImage blockSize); //获得dark channel图
airlight = GetAirLight(darkImage); //获得大气光Airlight
Mat = GetT(darkImage w0 airlight); //计算transmission
mat = guidedfilter_color(pImage Mat 20 0.001);
resImage = GetResultColorImage(pImage mat airlight t0); //获得修正t后的去雾图像
}
finish = clock(); //程序结束时间
double duration = (double)(finish - start) / CLOCKS_PER_SEC; //计算程序运行的时间
time.Format(“%lf“ duration);
return resImage;
}
/****************************************************************************************
*
* 函数名称:
* GetDarkChannel()
*
* 参数:
* IplImage *srcImage - 要处理的原图像的指针
* int blockSize - 选取的块的大小
*
* 返回值
* CvMat* - 成功返回CvMat的指针。
*
* 说明:
* 该函数计算srcImage图像的dark channel prior图,并将结果存储一个CvMat对象中。
*
*****************************************************************************************/
CvMat* CDarkChannelPrior::GetDarkChannel(IplImage *srcImage int blockSize)
{
int height = srcImage->height;
int width = srcImage->width;
int channels = srcImage->nChannels;
int win_size = (blockSize - 1)/2;
IplImage *R = cvCreateImage(cvGetSize(srcImage) srcImage->depth 1);
IplImage *G = cvCreateImage(cvGet
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 42845 2011-03-28 11:31 RemoveHaze\CLAHE.CPP
文件 2370 2011-01-13 17:31 RemoveHaze\CLAHE.H
文件 28184 2011-03-28 11:00 RemoveHaze\DarkChannelPrior.cpp
文件 1381 2011-01-09 15:49 RemoveHaze\DarkChannelPrior.h
文件 34507 2011-10-14 11:11 RemoveHaze\Debug\CLAHE.obj
文件 0 2011-10-14 11:11 RemoveHaze\Debug\CLAHE.sbr
文件 71592 2011-03-28 11:07 RemoveHaze\Debug\DarkChannelPrior.obj
文件 0 2011-03-28 11:07 RemoveHaze\Debug\DarkChannelPrior.sbr
文件 11385 2011-03-28 11:07 RemoveHaze\Debug\Morphology.obj
文件 0 2011-03-28 11:07 RemoveHaze\Debug\Morphology.sbr
文件 5948416 2011-10-14 11:11 RemoveHaze\Debug\RemoveHaze.bsc
文件 180336 2011-10-14 11:11 RemoveHaze\Debug\RemoveHaze.exe
文件 346632 2011-10-14 11:11 RemoveHaze\Debug\RemoveHaze.ilk
文件 17594 2011-03-13 16:05 RemoveHaze\Debug\RemoveHaze.obj
文件 7036544 2011-01-13 10:09 RemoveHaze\Debug\RemoveHaze.pch
文件 566272 2011-10-14 11:11 RemoveHaze\Debug\RemoveHaze.pdb
文件 3488 2011-02-24 14:43 RemoveHaze\Debug\RemoveHaze.res
文件 0 2011-03-13 16:05 RemoveHaze\Debug\RemoveHaze.sbr
文件 94054 2011-03-19 14:57 RemoveHaze\Debug\RemoveHazeDlg.obj
文件 0 2011-03-19 14:57 RemoveHaze\Debug\RemoveHazeDlg.sbr
文件 21698 2011-03-28 11:07 RemoveHaze\Debug\Retinex.obj
文件 0 2011-03-28 11:07 RemoveHaze\Debug\Retinex.sbr
文件 105860 2011-01-13 10:09 RemoveHaze\Debug\StdAfx.obj
文件 1374962 2011-01-13 10:09 RemoveHaze\Debug\StdAfx.sbr
文件 312320 2011-10-24 10:24 RemoveHaze\Debug\vc60.idb
文件 462848 2011-10-14 11:11 RemoveHaze\Debug\vc60.pdb
文件 3968 2011-03-28 09:48 RemoveHaze\Morphology.cpp
文件 446 2011-01-20 10:02 RemoveHaze\Morphology.h
文件 3651 2010-12-24 11:24 RemoveHaze\ReadMe.txt
文件 22572 2011-10-14 11:10 RemoveHaze\RemoveHaze.aps
............此处省略25个文件信息
- 上一篇:基于VHDL的程序设计集
- 下一篇:网络组建与维护实训
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论