#include "ImageDehazing.h"
#include "readImg.h"
#include "glog/logging.h"
#include "gflags/gflags.h"
#if _DEBUG
#pragma comment(lib,"gflags_static_d.lib")
#pragma comment(lib,"gflags_nothreads_static_d.lib")
#else
#pragma comment(lib,"gflags_static.lib")
#pragma comment(lib,"gflags_nothreads_static.lib")
#endif
#pragma comment(lib,"shlwapi.lib")
//视频去雾;
void VideoDehaze(string& videofile)
{
CImageDehazing dehaze;
VideoCapture cap;
cap.open(videofile);
if (!cap.isOpened())
{
return;
}
Mat frame;
while (cap.read(frame))
{
Mat dehazed_img;
CStatisticalTime statisticaltime;
statisticaltime.startTime();
dehaze.process(frame, dehazed_img);
cout << statisticaltime.endTime() << endl;
imshow("original img", frame);
imshow("dehaze img", dehazed_img);
if(27 == waitKey(15))
break;
}
destroyAllWindows();
}
//图像去雾;
void ImageDehaze(string& imagepath)
{
CImageDehazing dehaze;
Mat img = imread(imagepath);
//dehaze.resize_img(img, img);
Mat dehazed_img;
dehaze.process(img, dehazed_img);
imshow("original img", img);
imshow("dehaze img", dehazed_img);
//imwrite("../non_local_dehazing_code/non_local_dehazing/images/originalimg.jpg", img);
imwrite("../../images/dehazed_he_vs.jpg", dehazed_img);
waitKey(0);
}
//文件夹图像去雾;
void FolderDehaze_image(string& folderpath)
{
CImageDehazing dehaze;
readImg rdImage;
const string feature = "*";
vector<string> filenames;
rdImage.readImage(folderpath, feature, filenames);
auto it = filenames.begin();
while (it != filenames.end())
{
Mat img = imread(*it);
dehaze.resize_img(img, img);
Mat dehazed_img;
CStatisticalTime statisticaltime;
statisticaltime.startTime();
dehaze.process(img, dehazed_img);
cout << statisticaltime.endTime() << endl;
//imwrite("Org_images/original.jpg", img);
//imwrite("Org_images/dehazed.jpg", dehazed_img);
cout << *it << endl;
imshow("original", img);
imshow("dehaze", dehazed_img);
waitKey(0);
it++;
}
}
DEFINE_int32(user_choice, 0, "0:nothing\n 1:video/n 2:path\n 3:image\n");
DEFINE_string(video_name, "test.avi", "video file name");
DEFINE_string(image_path, "test", "image file path");
DEFINE_string(image_name, "test.jpg", "image file name");
int main(int argc,char* argv[])
{
google::InitGoogleLogging(argv[0]);
gflags::ParseCommandLineFlags(&argc, &argv, true);
switch (FLAGS_user_choice)
{
case 1:
VideoDehaze(FLAGS_video_name);
break;
case 2:
FolderDehaze_image(FLAGS_image_path);
break;
case 3:
ImageDehaze(FLAGS_image_name);
break;
default:
break;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
基于C++和OpenCV实现基于暗通道先验的图像去雾算法+源代码+文档说明(高分课程设计)
共424个文件
hpp:143个
h:69个
dll:45个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 145 浏览量
2024-05-08
02:44:31
上传
评论
收藏 163.88MB ZIP 举报
温馨提示
<项目介绍> I(x)=J(x)*t(x)+A(1-t(x)) 1.求图像暗通道;dark(x)=min (k,k) (min (R,G,B) ( J(x) )) 2.利用暗通道估计大气光(A); (1)选取暗通道图像暗通道最亮的0.1%的像素(一般来说,这些像素表示雾浓度最大的地方); (2)取输入图像里面这些像素对应的像素里面最亮的作为大气光; 注:这 - 不懂运行,下载完可以私聊问,可远程教学 该资源内项目源码是个人的毕设,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 --------
资源推荐
资源详情
资源评论
收起资源包目录
基于C++和OpenCV实现基于暗通道先验的图像去雾算法+源代码+文档说明(高分课程设计)
(424个子文件)
自然有雾图像.7z 23.46MB
hazeroad.avi 18.28MB
cross.avi 5.97MB
riverside.avi 2.26MB
hongkong.bmp 1.05MB
hongkong.bmp 1.05MB
ny1.bmp 1010KB
ny1.bmp 1010KB
canyon2.bmp 792KB
canyon2.bmp 792KB
tiananmen1.bmp 791KB
tiananmen1.bmp 791KB
gugong.bmp 703KB
canon3.bmp 703KB
train.bmp 703KB
gugong.bmp 703KB
canon3.bmp 703KB
train.bmp 703KB
ny3.bmp 235KB
ny3.bmp 235KB
OpenCVConfig.cmake 16KB
OpenCVModules-release.cmake 12KB
OpenCVModules-debug.cmake 11KB
OpenCVModules.cmake 5KB
main.cpp 2KB
ImageDehazing.cpp 28B
readImg.cpp 23B
opencv_imgproc310d.dll 32.56MB
opencv_imgproc310d.dll 32.56MB
opencv_imgproc310.dll 24.35MB
opencv_core310d.dll 15.31MB
opencv_ffmpeg310_64.dll 12.35MB
opencv_core310.dll 10.59MB
opencv_core310.dll 10.59MB
opencv_imgcodecs310d.dll 5.3MB
opencv_calib3d310d.dll 3.65MB
opencv_imgcodecs310.dll 2.7MB
opencv_imgcodecs310.dll 2.7MB
opencv_stitching310d.dll 2.26MB
opencv_features2d310d.dll 2.17MB
opencv_photo310d.dll 1.86MB
opencv_calib3d310.dll 1.73MB
opencv_calib3d310.dll 1.73MB
opencv_ml310d.dll 1.55MB
opencv_flann310d.dll 1.52MB
opencv_objdetect310d.dll 1.51MB
opencv_videostab310d.dll 1.29MB
opencv_stitching310.dll 1.03MB
opencv_photo310.dll 1.01MB
opencv_video310d.dll 990KB
msvcr120.dll 948KB
opencv_features2d310.dll 900KB
opencv_ml310.dll 783KB
opencv_shape310d.dll 767KB
opencv_objdetect310.dll 686KB
opencv_superres310d.dll 650KB
opencv_videoio310d.dll 647KB
opencv_videoio310d.dll 647KB
opencv_videostab310.dll 642KB
opencv_flann310.dll 624KB
opencv_video310.dll 495KB
opencv_video310.dll 495KB
msvcp120.dll 445KB
opencv_highgui310d.dll 381KB
opencv_shape310.dll 345KB
opencv_superres310.dll 290KB
opencv_videoio310.dll 274KB
libglog_d.dll 255KB
vccorlib120.dll 242KB
opencv_highgui310.dll 155KB
opencv_highgui310.dll 155KB
libglog.dll 86KB
opencv_traincascaded.exe 1.02MB
opencv_traincascade.exe 447KB
opencv_annotationd.exe 149KB
ImageDehazed.exe 133KB
opencv_createsamplesd.exe 132KB
opencv_annotation.exe 58KB
opencv_createsamples.exe 44KB
ImageDehazed.vcxproj.filters 2KB
core_c.h 127KB
logging.h 63KB
types_c.h 59KB
imgproc_c.h 51KB
kmeans_index.h 36KB
videoio_c.h 34KB
gflags.h 29KB
dist.h 27KB
hierarchical_clustering_index.h 25KB
autotuned_index.h 20KB
kdtree_single_index.h 20KB
calib3d_c.h 20KB
kdtree_index.h 19KB
lsh_table.h 18KB
types_c.h 17KB
cvdef.h 15KB
lsh_index.h 15KB
result_set.h 15KB
ImageDehazing.h 14KB
tracking_c.h 11KB
共 424 条
- 1
- 2
- 3
- 4
- 5
资源评论
奋斗奋斗再奋斗的ajie
- 粉丝: 450
- 资源: 2268
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功