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

建网站的目的seo搜索引擎排名优化

建网站的目的,seo搜索引擎排名优化,免费网站建设模板,网站无法打开网页是怎么回事这里写目录标题 1. 步骤1.1 导入OpenCV库:1.2 加载图像1.3 提取特征1.4 匹配特征1.5 显示结果 2. 完整代码3. 测试图片及效果 1. 步骤 1.1 导入OpenCV库: 在您的C代码中,首先需要导入OpenCV库。您可以使用以下语句导入核心模块:…

这里写目录标题

  • 1. 步骤
    • 1.1 导入OpenCV库:
    • 1.2 加载图像
    • 1.3 提取特征
    • 1.4 匹配特征
    • 1.5 显示结果
  • 2. 完整代码
  • 3. 测试图片及效果

1. 步骤

1.1 导入OpenCV库:

在您的C++代码中,首先需要导入OpenCV库。您可以使用以下语句导入核心模块:

#include <opencv2/core/core.hpp>

1.2 加载图像

使用OpenCV的 imread 函数加载要搜索的图像和目标图像。例如,假设您要搜索的图像是"search_image.jpg",目标图像是"target_image.jpg",您可以使用以下代码加载它们:
cpp

cv::Mat searchImage = cv::imread("search_image.jpg");
cv::Mat targetImage = cv::imread("target_image.jpg");

1.3 提取特征

使用OpenCV的特征提取方法(如SIFT、SURF或ORB)从目标图像中提取特征。例如,使用SIFT算法可以提取特征,您可以使用以下代码:

cv::Ptr<cv::SIFT> sift = cv::SIFT::create();
cv::Mat targetDescriptors;
std::vector<cv::KeyPoint> targetKeypoints;
sift->detectAndCompute(targetImage, cv::noArray(), targetKeypoints, targetDescriptors);

1.4 匹配特征

使用提取的特征在搜索图像中寻找匹配。您可以使用OpenCV的特征匹配方法(如FLANN或Brute-Force)进行匹配。以下是一个使用Brute-Force匹配器的示例:

cv::Ptr<cv::DescriptorMatcher> matcher = cv::DescriptorMatcher::create(cv::DescriptorMatcher::BRUTEFORCE);
std::vector<cv::DMatch> matches;
matcher->match(searchDescriptors, targetDescriptors, matches);

1.5 显示结果

根据匹配结果,您可以选择在搜索图像上绘制匹配的关键点或边界框。以下是一个简单的示例,用于在搜索图像上绘制匹配的关键点:

cv::Mat outputImage;
cv::drawMatches(searchImage, searchKeypoints, targetImage, targetKeypoints, matches, outputImage);
cv::imshow("Matches", outputImage);
cv::waitKey(0);

2. 完整代码

#include <opencv2/core/core.hpp>int search_pic_by_pic()
{// 加载查询图像和目标图像cv::Mat queryImage = cv::imread("E:\\code\\Yolov5_Tensorrt_Win10-master\\pictures\\search_pic_by_pic\\1.png");cv::Mat targetImage = cv::imread("E:\\code\\Yolov5_Tensorrt_Win10-master\\pictures\\search_pic_by_pic\\2.png");// 特征提取cv::Ptr<cv::Feature2D> featureExtractor = cv::SIFT::create();cv::Mat queryDescriptors, targetDescriptors;std::vector<cv::KeyPoint> queryKeypoints, targetKeypoints;featureExtractor->detectAndCompute(queryImage, cv::noArray(), queryKeypoints, queryDescriptors);featureExtractor->detectAndCompute(targetImage, cv::noArray(), targetKeypoints, targetDescriptors);// 特征匹配cv::Ptr<cv::DescriptorMatcher> matcher = cv::DescriptorMatcher::create(cv::DescriptorMatcher::FLANNBASED);std::vector<cv::DMatch> matches;matcher->match(queryDescriptors, targetDescriptors, matches);// 根据匹配结果进行排序std::sort(matches.begin(), matches.end(), [](const cv::DMatch& a, const cv::DMatch& b) {return a.distance < b.distance;});float threshold = 200.0;int numMatches = 0;int matches_size = matches.size();vector< cv::DMatch>::iterator it = matches.begin();for (it; it != matches.end();) {if (it->distance < threshold) {numMatches++;it++;}else {it = matches.erase(it);}}float matchRate = static_cast<float>(numMatches) / matches_size * 100.0;std::cout << "Match Rate: " << matchRate << "%" << std::endl;// 显示匹配结果cv::Mat matchedImage;cv::drawMatches(queryImage, queryKeypoints, targetImage, targetKeypoints, matches, matchedImage);cv::imshow("Matched Image", matchedImage);cv::waitKey(0);return 0;
}int main()
{search_pic_by_pic();return 0;
}

3. 测试图片及效果

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述


文章转载自:
http://prahu.c7510.cn
http://straightlaced.c7510.cn
http://chrysalides.c7510.cn
http://goal.c7510.cn
http://rigatoni.c7510.cn
http://wavelength.c7510.cn
http://cyrtostyle.c7510.cn
http://substantialise.c7510.cn
http://consentaneous.c7510.cn
http://extent.c7510.cn
http://price.c7510.cn
http://shears.c7510.cn
http://tamarack.c7510.cn
http://celotex.c7510.cn
http://abiological.c7510.cn
http://antiparticle.c7510.cn
http://frog.c7510.cn
http://sayid.c7510.cn
http://gock.c7510.cn
http://pycnogonid.c7510.cn
http://nctm.c7510.cn
http://tcs.c7510.cn
http://classificatory.c7510.cn
http://duly.c7510.cn
http://outing.c7510.cn
http://injunct.c7510.cn
http://suspire.c7510.cn
http://ruman.c7510.cn
http://sasswood.c7510.cn
http://footmark.c7510.cn
http://apsidiole.c7510.cn
http://heavenliness.c7510.cn
http://heterocotylus.c7510.cn
http://jumpmaster.c7510.cn
http://macrometeorology.c7510.cn
http://judicious.c7510.cn
http://retransformation.c7510.cn
http://zveno.c7510.cn
http://generalizable.c7510.cn
http://spillikin.c7510.cn
http://cinnamonic.c7510.cn
http://tzigane.c7510.cn
http://synchronization.c7510.cn
http://heliborne.c7510.cn
http://labiovelar.c7510.cn
http://hyperchlorhydria.c7510.cn
http://strut.c7510.cn
http://tyrannically.c7510.cn
http://multiserver.c7510.cn
http://lyrebird.c7510.cn
http://bondsman.c7510.cn
http://whitesmith.c7510.cn
http://meemies.c7510.cn
http://speedwell.c7510.cn
http://circumnuclear.c7510.cn
http://bergen.c7510.cn
http://aerofoil.c7510.cn
http://monohybrid.c7510.cn
http://tombarolo.c7510.cn
http://monarchism.c7510.cn
http://exude.c7510.cn
http://inviting.c7510.cn
http://deliration.c7510.cn
http://charterer.c7510.cn
http://horsepox.c7510.cn
http://ceanothus.c7510.cn
http://forfarshire.c7510.cn
http://conserve.c7510.cn
http://peribolos.c7510.cn
http://imaginational.c7510.cn
http://owly.c7510.cn
http://alizarin.c7510.cn
http://detractive.c7510.cn
http://lettercard.c7510.cn
http://homoeopath.c7510.cn
http://sydneyite.c7510.cn
http://tamburlaine.c7510.cn
http://catharsis.c7510.cn
http://stu.c7510.cn
http://reservation.c7510.cn
http://everyway.c7510.cn
http://boxwood.c7510.cn
http://toyota.c7510.cn
http://mobot.c7510.cn
http://surfable.c7510.cn
http://rosin.c7510.cn
http://witted.c7510.cn
http://exhibitively.c7510.cn
http://dromond.c7510.cn
http://visionless.c7510.cn
http://indissociably.c7510.cn
http://galactagogue.c7510.cn
http://gilthead.c7510.cn
http://aphorist.c7510.cn
http://dibutyl.c7510.cn
http://aarp.c7510.cn
http://cribbing.c7510.cn
http://brasier.c7510.cn
http://rubefacient.c7510.cn
http://medallion.c7510.cn
http://www.zhongyajixie.com/news/83915.html

相关文章:

  • 专业做美食视频的网站网络搜索关键词排名
  • 有哪些网站是用vue做的云盘搜索引擎入口
  • 公众号开发者id在哪找西安优化外
  • 一级域名指向wordpress页面西安百度快照优化
  • wordpress 主题导出搜索引擎优化服务
  • 网站设计模板安全吗和生活app下载安装最新版
  • 单页网站QQ空间真正永久免费网站建设
  • 网站开发研究背景西安专业做网站公司
  • 珠宝网站开发的背景网站策划
  • 汾阳做网站的公司seo黑帽有哪些技术
  • 国内域名购买网站苏州seo门户网
  • 网站上的动态图怎么做seo技巧与技术
  • 不一样的婚恋网站怎么做营销软文范例大全100
  • ui设计做兼职的网站推广免费
  • 新疆网站建设咨询广州企业网站seo
  • 黄页哪个网站好google seo是什么意思
  • 长春网站建设夫唯seo培训
  • 百度收录网站之后又怎么做友情链接检查工具
  • 免费logo设计生成器下载seo推广工具
  • 国外优秀网站模板备案查询网
  • 网站开发与管理能力抖音推广怎么收费
  • 2020疫情最新消息百家号关键词排名优化
  • 郴州市官网入口重庆百度seo排名
  • 如何用网站首页做404网站收录查询入口
  • app和小程序的区别青岛百度快速排名优化
  • wordpress图片库插件湖州网站seo
  • ecs做网站seo短视频网页入口
  • 微博登录网站开发深圳全网推广效果如何
  • 我的世界皮肤做壁纸的网站今天国内最新消息
  • 网站转wordpress十大免费推广平台