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

  • 大小: 5.57MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-08-11
  • 語言: 其他
  • 標簽: opencv??

資源簡介

圖像匹配是指通過一定的匹配算法在兩幅或多幅圖像之間識別同名點,如二維圖像匹配中通過比較目標區和搜索區中相同大小的窗口的相關系數,取搜索區中相關系數最大所對應的窗口中心點作為同名點。其實質是在基元相似性的條件下,運用匹配準則的最佳搜索問題。

資源截圖

代碼片段和文件信息

//?3.cpp?:?定義控制臺應用程序的入口點。
//

#include?“stdafx.h“


int?_tmain(int?argc?_TCHAR*?argv[])
{
return?0;
}

#include?“opencv2/core/core.hpp“??
#include?“opencv2/features2d/features2d.hpp“??
#include?“opencv2/highgui/highgui.hpp“??
#include?“opencv2/calib3d/calib3d.hpp“??
#include?“opencv2/nonfree/nonfree.hpp“??
#include???
#include
using?namespace?cv;??
using?namespace?std;??
??
int?main(??)??
{??
????//【0】改變console字體顏色??
????system(“color?1F“);???
??
??
????//【1】載入原始圖片??
????Mat?srcImage1?=?imread(?“A1.jpg“?1?);??
????Mat?srcImage2?=?imread(?“A2.jpg“?1?);??
????Mat?copysrcImage1=srcImage1.clone();??
????Mat?copysrcImage2=srcImage2.clone();??
??
????if(?!srcImage1.data?||?!srcImage2.data?)??
????{?printf(“讀取圖片錯誤,請確定目錄下是否有imread函數指定的圖片存在~!?\n“);?return?false;?}????
??
????//【2】使用SURF算子檢測關鍵點??
????int?minHessian?=?400;//SURF算法中的hessian閾值??
????SurfFeatureDetector?detector(?minHessian?);//定義一個SurfFeatureDetector(SURF)?特征檢測類對象????
????vector?keypoints_object?keypoints_scene;//vector模板類,存放任意類型的動態數組??
??
????//【3】調用detect函數檢測出SURF特征關鍵點,保存在vector容器中??
????detector.detect(?srcImage1?keypoints_object?);??
????detector.detect(?srcImage2?keypoints_scene?);??
////SIFT特征檢測
//????SiftFeatureDetector?detector;????????//定義特點點檢測器
//????//vector?keypoint01keypoint02;//定義兩個容器存放特征點
//????detector.detect(srcImage1keypoints_object);
//????detector.detect(srcImage2keypoints_scene);
??
????//【4】計算描述符(特征向量)??
????SurfDescriptorExtractor?extractor;??
????Mat?descriptors_object?descriptors_scene;??
????extractor.compute(?srcImage1?keypoints_object?descriptors_object?);??
????extractor.compute(?srcImage2?keypoints_scene?descriptors_scene?);??
??
????////【5】使用FLANN匹配算子進行匹配??
????//FlannbasedMatcher?matcher;??
????//vector?matches;??
????//matcher.match(?descriptors_object?descriptors_scene?matches?);??

BruteForceMatcher>?matcher;
????vector?matches;
???
????matcher.match(descriptors_objectdescriptors_scenematches);
???

double?max_dist?=?0;?double?min_dist?=?100;//最小距離和最大距離??
??
????//【6】計算出關鍵點之間距離的最大值和最小值??
????for(?int?i?=?0;?i?riptors_object.rows;?i++?)??
????{???
????????double?dist?=?matches[i].distance;??
????????if(?dist?????????if(?dist?>?max_dist?)?max_dist?=?dist;??
????}??
??
????printf(“>Max?dist?最大距離?:?%f?\n“?max_dist?);??
????printf(“>Min?dist?最小距離?:?%f?\n“?min_dist?);??
??
????//【7】存下匹配距離小于3*min_dist的點對??
????std::vector?good_matches;??
????for(?int?i?=?0;?i?riptors_object.rows;?i++?)??
????{???
????????if(?matches[i].distance?????????{???
????????????good_matches.push_back(?matches[i]);??
????????}??
????}??
??
????//繪制出匹配到的關鍵點??
????Mat?img_matches;??
????drawMatches(?srcImage1?keypoints_object?srcImage2?keypoints_scene??
????????good_matches?img_matches?Scalar::all(-1)?Scalar::all(-1)?

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-12-08?20:04??jingquepipei\
?????目錄???????????0??2017-11-10?09:56??jingquepipei\3\
?????文件????????6099??2017-11-18?16:45??jingquepipei\3\3.cpp
?????文件????????4356??2017-11-10?09:55??jingquepipei\3\3.vcxproj
?????文件????????1305??2017-11-10?09:55??jingquepipei\3\3.vcxproj.filters
?????文件?????????143??2017-11-10?09:55??jingquepipei\3\3.vcxproj.user
?????文件???????30411??2009-04-23?20:42??jingquepipei\3\A1.jpg
?????文件???????26986??2009-04-23?20:43??jingquepipei\3\A2.jpg
?????目錄???????????0??2017-12-08?20:04??jingquepipei\3\Debug\
?????文件?????????406??2017-11-10?09:56??jingquepipei\3\Debug\3.exe.embed.manifest
?????文件?????????472??2017-11-18?15:59??jingquepipei\3\Debug\3.exe.embed.manifest.res
?????文件?????????381??2017-11-18?16:45??jingquepipei\3\Debug\3.exe.intermediate.manifest
?????文件??????????52??2017-12-08?20:04??jingquepipei\3\Debug\3.lastbuildstate
?????文件?????????848??2017-12-08?20:04??jingquepipei\3\Debug\3.log
?????文件??????415813??2017-11-18?16:45??jingquepipei\3\Debug\3.obj
?????文件?????1179648??2017-11-18?15:59??jingquepipei\3\Debug\3.pch
?????文件?????????192??2017-11-10?09:56??jingquepipei\3\Debug\3_manifest.rc
?????文件???????19068??2017-11-18?16:45??jingquepipei\3\Debug\CL.read.1.tlog
?????文件????????1000??2017-11-18?16:45??jingquepipei\3\Debug\CL.write.1.tlog
?????文件????????2522??2017-11-18?16:45??jingquepipei\3\Debug\cl.command.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link-cvtres.read.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link-cvtres.write.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link.33488-cvtres.read.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link.33488-cvtres.write.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link.33488.read.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link.33488.write.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link.35720-cvtres.read.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link.35720-cvtres.write.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link.35720.read.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link.35720.write.1.tlog
?????文件???????????2??2017-11-18?16:45??jingquepipei\3\Debug\link.35752-cvtres.read.1.tlog
............此處省略37個文件信息

評論

共有 條評論