当前位置: 首页 > wzjs >正文

狂人站群系统免费网站推广网址

狂人站群系统,免费网站推广网址,360seo排名点击软件,青海商城网站建设操作系统:ubuntu22.04 OpenCV版本:OpenCV4.9 IDE:Visual Studio Code 编程语言:C11 算法描述 cv::detail::findMaxSpanningTree 是 OpenCV 中用于图像拼接工作流的一个函数,它帮助构建一个最大生成树(Maximum Spanni…
  • 操作系统:ubuntu22.04
  • OpenCV版本:OpenCV4.9
  • IDE:Visual Studio Code
  • 编程语言:C++11

算法描述

cv::detail::findMaxSpanningTree 是 OpenCV 中用于图像拼接工作流的一个函数,它帮助构建一个最大生成树(Maximum Spanning Tree),这在图像拼接中用于确定图像之间的最佳连接方式。这个函数特别适用于处理多个图像间的匹配信息,并基于这些信息来构建一个图结构,从而为后续的图像拼接步骤提供基础。

函数原型

void cv::detail::findMaxSpanningTree 	
(int  	num_images,const std::vector< MatchesInfo > &  	pairwise_matches,Graph &  	span_tree,std::vector< int > &  	centers ) 	

参数

  • num_images: 图像的数量。
  • pairwise_matches: 包含每对图像之间匹配信息的向量。每个 MatchesInfo 结构体包含了两个图像之间的匹配点、置信度等信息。
  • span_tree: 输出参数,表示由函数计算得到的最大生成树。这个图结构描述了如何以最优的方式将所有图像连接起来。
  • centers: 输出参数,包含可能作为拼接中心的图像索引列表。在全景拼接中,通常选择一个或几个中心图像来开始拼接过程。

代码示例

#include <opencv2/opencv.hpp>
#include <opencv2/stitching/detail/matchers.hpp>
#include <opencv2/stitching/detail/util.hpp>#include <iostream>
#include <vector>using namespace cv;
using namespace cv::detail;int main() {// 加载图像(此处仅作示意,实际应用中需要加载真实图像)std::vector<std::string> img_filenames = {"/media/dingxin/data/study/OpenCV/sources/images/left01.jpg","/media/dingxin/data/study/OpenCV/sources/images/right01.jpg","/media/dingxin/data/study/OpenCV/sources/images/right01.jpg"};std::vector<cv::Mat> imgs;for (const auto& filename : img_filenames) {cv::Mat img = cv::imread(filename);if (img.empty()) {std::cerr << "无法加载图像: " << filename << std::endl;return -1;}imgs.push_back(img);}// 初始化特征检测器和描述符提取器Ptr<Feature2D> detector = ORB::create();BestOf2NearestMatcher matcher(false, 0.3f);// 计算每张图像的特征点std::vector<ImageFeatures> features(imgs.size());for (size_t i = 0; i < imgs.size(); ++i) {detector->detectAndCompute(imgs[i], Mat(), features[i].keypoints, features[i].descriptors);}// 匹配特征点std::vector<MatchesInfo> pairwise_matches;matcher(features, pairwise_matches);// 构建最大生成树Graph span_tree;std::vector<int> centers;findMaxSpanningTree(imgs.size(), pairwise_matches, span_tree, centers);// 打印中心图像索引std::cout << "Centers: ";for (int center : centers) {std::cout << center << " ";}std::cout << std::endl;// 手动重建最大生成树的边std::vector<bool> visited(imgs.size(), false);for (int center : centers) {std::cout << "Starting from center: " << center << std::endl;visited[center] = true;for (size_t i = 0; i < pairwise_matches.size(); ++i) {const MatchesInfo& match_info = pairwise_matches[i];if (match_info.confidence > 0 && !visited[match_info.src_img_idx] && !visited[match_info.dst_img_idx]) {std::cout << "(" << match_info.src_img_idx << ", " << match_info.dst_img_idx << ")" << std::endl;visited[match_info.src_img_idx] = true;visited[match_info.dst_img_idx] = true;}}}return 0;
}

运行结果

Centers: 2 
Starting from center: 2
(0, 1)
http://www.dtcms.com/wzjs/160156.html

相关文章:

  • 找网络公司做网站需要注意的国家免费技能培训
  • 南通工程建设信息网站环球网最新消息
  • 唐山网站建设外包公司哪家好数据分析师培训机构
  • 网页前端开发框架seo关键词怎么优化
  • 千龙网站建设3000块钱在朋友圈投放广告
  • 有哪些好的做网站软件怎么推广
  • wordpress 网站建设中天津百度推广公司地址
  • 深圳网页制作推广哪家好搜索引擎优化的简写是
  • 做的最好的宠物网站成都网络营销公司哪家好
  • 如何用华为云服务器做网站网络营销的公司有哪些
  • 网站实时K线怎么做怎样制作网页设计
  • 百度地图导航客服seo推广教程seo推广技巧
  • 做网站赚钱缴税吗郑州seo代理外包公司
  • 网站备案查询长春网站开发
  • 创意福州网站建设中国最新领导班子
  • 网站代码下载猪八戒网接单平台
  • 高端网站建设公司兴田德润可以不软文营销经典案例
  • 河东做网站seo培训班
  • 德阳网站制作推广页面制作
  • 无锡做网站设计的公司刚刚突发1惊天大事
  • 南安seo教程泰州seo外包公司
  • 北海公司做网站seo推广的网站和平台有哪些
  • 实实通信的视频网站怎么做网站搜索引擎优化案例
  • 如何做能上传视频网站自媒体引流推广
  • 国内阿里巴巴网站怎么做合肥网站优化推广方案
  • 网站公司排行榜最近一周的重大新闻
  • 做网站需要用到的软件杭州营销策划公司排名
  • 前程无忧做简历网站网络运营策划
  • 怎么查网站的备案信息微信推广软件有哪些
  • wordpress公司主题网站优化推广排名