资源简介
这是一篇C++图像融合的论文的代码,写的挺好的,值得参考。想看论文去搜索同名论文
代码片段和文件信息
#include “global.h“
// System
#include
#include
// OpenCV
#include “opencv2/core/core.hpp“
#include “opencv2/imgproc/imgproc.hpp“
#include “opencv2/highgui/highgui.hpp“
#include “align_fill.h“
#include “segment.h“
#include “select_combine.h“
//#define RUN_MY_MODIFIED_PROGRAM 1
//usage: ./segment depth_data.xml multi_focus.avi
int main(int argc char* argv[])
{
// check input parameters
if(argc != 3)
{
std::cout << “Invalid parameters“ << std::endl;
return -1;
}
// initialize the look up table for visualizing depth map
InitializeDepthColorTable();
// load depth map data from *.xml
cv::Mat depth;
cv::FileStorage depth_data(argv[1] cv::FileStorage::READ);
depth_data[“data“] >> depth;
//cv::flip(depth depth 1);
CV_Assert( depth.type() == CV_64FC1 );
depth.convertTo(depth CV_16UC1);
// align depth map with color image
cv::Mat aligned_depth;
AlignDepthWithColor(depth aligned_depth);
// create the depth map segmentation class
const double coc_diameter = 0.019; // diameter of the circle of confusion
const double aperture_value = 4.0;
const double focal_length = 24;
GraphbasedImageSeg* ptr_graph_based_seger = new GraphbasedImageSeg(coc_diameter aperture_value focal_length);
// segment
aligned_depth.convertTo(aligned_depth CV_64F);
cv::Mat dst_color;
int small_thresh = 10; // small components removing
std::vector segmented_regions;
int regions = ptr_graph_based_seger->GraphSegment(aligned_depth small_thresh segmented_regions dst_color);
printf(“Segmented regions: %d\n“ regions);
cv::imwrite(“segmentation_result.jpg“ dst_color);
// construct all_in_focus image
cv::Mat all_in_focus_img;
int ret = ConstructAllInFocusImage(segmented_regions argv[2] all_in_focus_img);
if(-1 == ret)
{
std::cout << “ConstructAllInFocusImage error“ << std::endl;
goto CLEAN_UP;
}
else
{
cv::imwrite(“all_in_focus.jpg“ all_in_focus_img);
}
CLEAN_UP:
delete ptr_graph_based_seger;
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\
目录 0 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\.deps\
文件 8 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\.deps\test.Po
文件 291 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\Makefile
目录 0 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\include\
文件 891 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\include\align_fill.h
文件 1628 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\include\disjoint.h
文件 310 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\include\global.h
文件 4528 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\include\segment.h
文件 1212 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\include\select_combine.h
文件 149 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\readme.txt
目录 0 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\src\
文件 5476 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\src\align_fill.cpp
文件 1066 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\src\disjoint.cpp
文件 2112 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\src\global.cpp
文件 7344 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\src\segment.cpp
文件 2839 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\src\select_combine.cpp
文件 607320 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\test
文件 2070 2017-10-29 13:16 Depth_Assisted_Multifocus_Image_Fusion-master\test.cpp
- 上一篇:c语言公交查询系统源码
- 下一篇:属性基加密c语言实现.zip
相关资源
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
- VC++基于OpenGL模拟的一个3维空间模型
- c++ 虚拟摄像头
- hook,捕获所有案件,查找所有窗口,
- C语言课设计算器
- c++ 简易贪吃蛇源码
- 高精度加法(c++代码)
- C++调用百度地图案例
- 北京化工大学计算方法(C/C++)讲义
- 基于VC++的SolidWorks二次开发SolidWorks
- c++ 模拟鼠标按键
- OFD编辑器
- Beginning C++17 From Novice to Professional
- C++ STL实现
- opencv手部轮廓识别以及轨迹识别
- 百度C++编码规范
- C++ sql2008 WebServer通讯.docx
- c++ 定时关机程序源码
- 基于VSCode和CMake实现C++开发
- c++语法查询工具
- c++ 账务系统源码
- GBT 28169-2011 嵌入式软件 C语言编码规范
- c++ 猜拳小游戏
- XUnZip Zip解压缩.rar
评论
共有 条评论