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

  • 大小: 447KB
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發布日期: 2021-06-16
  • 語言: 其他
  • 標簽: surf??

資源簡介

基于OpenCV的實現特征點提取和匹配的程序。

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?
#include??
#include?
#include?
#include?

int?main()
{
//?Read?input?images
cv::Mat?image1=?cv::imread(“OpticalFlow0.jpg“0);
cv::Mat?image2=?cv::imread(“OpticalFlow1.jpg“0);
if?(!image1.data?||?!image2.data)
return?0;?

????//?Display?the?images
cv::namedWindow(“Right?Image“);
cv::imshow(“Right?Image“image1);
cv::namedWindow(“Left?Image“);
cv::imshow(“Left?Image“image2);

//?vector?of?keypoints
std::vector?keypoints1;
std::vector?keypoints2;

//?Construction?of?the?SURF?feature?detector?
cv::SurfFeatureDetector?surf(3000);

//?Detection?of?the?SURF?features
surf.detect(image1keypoints1);
surf.detect(image2keypoints2);

std::cout?< std::cout?<
//?Draw?the?kepoints
cv::Mat?imageKP;
cv::drawKeypoints(image1keypoints1imageKPcv::Scalar(255255255)cv::DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
cv::namedWindow(“Right?SURF?Features“);
cv::imshow(“Right?SURF?Features“imageKP);
cv::drawKeypoints(image2keypoints2imageKPcv::Scalar(255255255)cv::DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
cv::namedWindow(“Left?SURF?Features“);
cv::imshow(“Left?SURF?Features“imageKP);

//?Construction?of?the?SURF?descriptor?extractor?
cv::SurfDescriptorExtractor?surfDesc;

//?Extraction?of?the?SURF?descriptors
cv::Mat?descriptors1?descriptors2;
surfDesc.compute(image1keypoints1descriptors1);
surfDesc.compute(image2keypoints2descriptors2);

std::cout?<riptor?matrix?size:?“?<riptors1.rows?<riptors1.cols?<
//?Construction?of?the?matcher?
cv::BruteForceMatcher?>?matcher;

//?Match?the?two?image?descriptors
std::vector?matches;
matcher.match(descriptors1descriptors2?matches);

std::cout?<
std::nth_element(matches.begin()????//?initial?position
?????????????matches.begin()+24?//?position?of?the?sorted?element
?matches.end());?????//?end?position
//?remove?all?elements?after?the?25th
matches.erase(matches.begin()+25?matches.end());?

cv::Mat?imageMatches;
cv::drawMatches(image1keypoints1??//?1st?image?and?its?keypoints
????????????image2keypoints2??//?2nd?image?and?its?keypoints
matches //?the?matches
imageMatches //?the?image?produced
cv::Scalar(255255255));?//?color?of?the?lines
cv::namedWindow(“Matches“);
cv::imshow(“Matches“imageMatches);

cv::waitKey();
return?0;

int?size=7;
cv::Mat?imaf1;
image1.convertTo(imaf1CV_32F);

cv::

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-01-06?13:25??HW3\
?????文件????????3080??2013-01-04?20:40??HW3\tracking.cpp
?????文件??????124031??2011-01-17?05:45??HW3\church01.jpg
?????文件???????48594??2013-01-04?20:41??HW3\tracking
?????文件??????120223??2008-10-07?17:00??HW3\OpticalFlow1.jpg
?????文件?????????115??2013-01-04?19:44??HW3\README
?????文件??????124874??2011-01-17?05:47??HW3\church02.jpg
?????文件??????123322??2008-10-07?17:00??HW3\OpticalFlow0.jpg

評論

共有 條評論