91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 16.79MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2024-01-31
  • 語言: 其他
  • 標簽:

資源簡介

基于單幅圖像的快速去霧算法的源代碼,可以直接運行的vs2010工程。去霧算法研究的同學可以看看。一種比較快速的圖片去霧算法的工程實現。此算法耗時較小,去霧效果也不錯。可以用于實時處理應用之中。

資源截圖

代碼片段和文件信息

/*
?*?作者:venjieliu
?*?時間:2017.5.12
?*?郵箱:venjieliu@gmail.com
?*/

#include?“stdafx.h“
#include?“Fast_dehaze_cpu.h“
#include?“dehaze_core.h“

Mat?read_image(char?*imgname)
{
Mat?img?=?imread(imgname?CV_LOAD_IMAGE_COLOR);
Mat?outimg(img.rowsimg.colsCV_8UC3);
img.convertTo(outimg?CV_8UC3);
return?outimg;
}

int?getM(Mat?&M?Mat?&M_max?const?Mat?&src?double?&m_av?double?&eps)
{
double?sum?=?0;
for?(int?i?=?0;?i? {
for?(int?j?=?0;?j? {
uchar?r?g?b;
uchar?temp1?temp2;
r?=?src.at(ij)[0];
g?=?src.at(ij)[1];
b?=?src.at(ij)[2];
temp1?=?my_min(my_min(r?g)?b);
temp2?=?my_max(my_max(r?g)?b);
M.at(i?j)?=?temp1;
M_max.at(i?j)?=?temp2;
sum?+=?temp1;
}
}
m_av?=?sum?/?(src.rows?*?src.cols?*?255);
eps?=?0.85/(m_av);
return?0;
}

int?getAveM(Mat?&M_ave?Mat?&M?int?r)
{
boxFilter(M?M_ave?CV_8UC1?Size(r?r));

return?0;
}

int?getL(Mat?&L?Mat?&M?Mat?&M_ave?double?eps?double?m_av)
{
double?delta?=?my_min(0.9?eps*m_av);
for?(int?i?=?0;?i? {
for?(int?j?=?0;?j? {
L.at(i?j)?=?(int)my_min(delta?*?M_ave.at(i?j)?M.at(i?j));
}
}

return?0;
}

int?MaxMatrix(Mat?&src)
{
int?temp?=?0;
for?(int?i?=?0;?i? {
for?(int?j?=?0;?j? temp?=?my_max(src.at(i?j)?temp);
if?(temp?==?255)
return?temp;
}
return?temp;
}

double?GetA(Mat?&M_max?Mat?&M_ave)
{
return?(MaxMatrix(M_max)?+?MaxMatrix(M_ave))?*?0.5;
}

int?dehaze(Mat?&dst?const?Mat?&src?Mat?&L?double?A)
{
int?temp?value;
for?(int?i?=?0;?i? {
for?(int?j?=?0;?j? {
temp?=?L.at(i?j);
for?(int?k?=?0;?k? {
value?=?A*(src.at(ij)[k]?-?temp)/?(A-temp);
if?(value?>?255)?value?=?255;
if?(value? dst.at(ij)[k]?=?value;
}
}
}
return?0;
}

Mat?autocontrost(Mat?&matface?int?cut_limit)
{

double?HistRed[256]={0};
double?HistGreen[256]={0};
double?HistBlue[256]={0};
int?bluemap[256]={0};
int?redmap[256]={0};
int?greenmap[256]={0};


for?(int?i=0;i {
for?(int?j=0;j {
int?iblue?=matface.at(ij)[0];
int?igreen=matface.at(ij)[1];
int?ired??=matface.at(ij)[2];
HistBlue[iblue]++;
HistGreen[igreen]++;
HistRed[ired]++;
}
}
int?PixelAmount?=?matface.rows*matface.cols;
int?isum?=?0;
//?blue
int?iminblue=0;int?imaxblue=0;
for?(int?y?=?0;y<256;y++)//這兩個操作我基本能夠了解了
{
isum=?isum+HistBlue[y];
if?(isum>=PixelAmount*cut_limit*0.01)
{
iminblue?=?y;
break;
}
}
isum?=?0;
for?(int?y=255;y>=0;y--)
{
isum=isum+HistBlue[y];
if?(isum>=PixelAmount*cut_limit*0.01)
{
imaxblue=y;
break;
}
}
//red
isum=0;
int?iminred=0;

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-08-09?11:21??Fast_dehaze_cpu_win7\
?????目錄???????????0??2017-04-11?17:16??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\
?????文件?????????774??2017-08-03?16:14??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Fast_dehaze_cpu.cpp
?????文件?????????477??2017-08-03?16:14??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Fast_dehaze_cpu.h
?????文件????????8770??2016-01-01?19:17??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Fast_dehaze_cpu.vcxproj
?????文件????????1604??2015-12-23?15:03??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Fast_dehaze_cpu.vcxproj.filters
?????文件?????????620??2017-06-01?15:35??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Fast_dehaze_cpu.vcxproj.user
?????文件????????1609??2015-12-23?15:01??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\ReadMe.txt
?????目錄???????????0??2017-08-09?11:21??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\
?????文件??????120794??2017-08-09?11:19??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\CL.read.1.tlog
?????文件????????6756??2017-08-09?11:19??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\CL.write.1.tlog
?????文件??????????94??2017-08-09?11:21??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\Fast_dehaze_cpu.lastbuildstate
?????文件????????2037??2017-08-09?11:21??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\Fast_dehaze_cpu.log
?????文件?????1091732??2017-08-03?18:32??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\Fast_dehaze_cpu.obj
?????文件?????1179648??2017-08-03?18:32??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\Fast_dehaze_cpu.pch
?????文件?????????713??2017-03-26?12:20??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\Fast_dehaze_cpu.vcxprojResolveAssemblyReference.cache
?????文件???????????0??2017-03-26?11:48??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\Fast_dehaze_cpu.write.1.tlog
?????文件????????8240??2017-08-09?11:19??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\cl.command.1.tlog
?????文件?????1122067??2017-08-09?11:19??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\dehaze_core.obj
?????文件????????5894??2017-08-09?11:21??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\link.command.1.tlog
?????文件???????12596??2017-08-09?11:21??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\link.read.1.tlog
?????文件????????2626??2017-08-09?11:21??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\link.write.1.tlog
?????文件???????30634??2017-08-03?18:32??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\stdafx.obj
?????文件??????880640??2017-08-09?11:19??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\Release\vc100.pdb
?????文件????????6152??2017-08-09?11:19??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\dehaze_core.cpp
?????文件?????????525??2017-08-03?16:13??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\dehaze_core.h
?????文件??????425334??2017-08-09?11:21??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\dehazing_cpu.png
?????目錄???????????0??2017-05-24?16:17??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\images\
?????文件??????119907??2015-12-02?11:10??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\images\1.jpg
?????文件?????1096856??2013-06-27?11:03??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\images\10.bmp
?????文件?????1034456??2013-06-27?11:03??Fast_dehaze_cpu_win7\Fast_dehaze_cpu\images\11.bmp
............此處省略213個文件信息

評論

共有 條評論