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

  • 大小: 9.88MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-10-19
  • 語言: C/C++
  • 標簽: opencv??圖像處理??

資源簡介

運用了opencv2.4.9版本在VS2012中進行兩張圖像的相關系數匹配,程序可以自動匹配和手動匹配,人性化

資源截圖

代碼片段和文件信息

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

#include?“stdafx.h“
using?namespace?std;
using?namespace?cv;

Mat?imgleft;Mat?imgright;Point?selectobjp;
Rect?roiRectselectRect;Point?startpendpoint;
bool?downflag=falseupflag=falseeventflag=false;
int?_tmain(int?argc?_TCHAR*?argv[])
{
Mat?left=imread(“Left50.jpg“);
if(left.empty())
return?-1;
Mat?right=imread(“Right49.jpg“);
if(right.empty())
return?-1;
//轉化為灰度圖像
cvtColor(leftimgleftCV_BGR2GRAY);
cvtColor(rightimgrightCV_BGR2GRAY);
imwrite(“Right49_.jpg“imgright);
Mat?imgleft1=imgleft.clone();Mat?imgright1=imgright.clone();//克隆一份,不直接用原始圖像

//簡單粗暴的Morevec?角點檢測試驗
/*Mat?MorevecCorners(Mat?srcimgint?ksizeint?threshold);
Mat?resMorMatL=MorevecCorners(imgleft1515000);
Mat?resMorMatR=MorevecCorners(imgright1515000);
imshow(“resMorMatL“resMorMatL);
imshow(“resMorMatR“resMorMatR);
waitKey(0);*/

//改進Harris算法的Shi-Tomasi算法角點檢測試驗
Mat?Shi_TomasiCorners(Mat?srcimgvector?&vec);
vector?vecCornersL;vector?vecCornersR;
Mat?resShi_TomasiL=Shi_TomasiCorners(imgleft1vecCornersL);
Mat?resShi_TomasiR=Shi_TomasiCorners(imgright1vecCornersR);
void?savecorners(bool?lorrvector?&?vec);
bool?isleft=trueisright=false;
savecorners(isleftvecCornersL);savecorners(isrightvecCornersR);//將算出的點保存,可用于自動輸入目標點代替肉眼尋找角點
//imshow(“resShi_TomasiL“resShi_TomasiL);
//imshow(“resShi_TomasiR“resShi_TomasiR);
waitKey(0);

void?trymatch();//函數說明
void?trymatch1(vector?&vec);
/*Point?Rmatchp(Mat?imgobjMat?imgscenePoint?objpPoint?topleftPoint?downrightint?winsizedouble?&maxR);*/
char?autoorhand;
cout<<“自動用計算所得角點匹配(y)或手動選擇角點匹配(n)?“;cin>>autoorhand;
if(autoorhand==‘y‘||autoorhand==‘Y‘)
trymatch1(vecCornersL);
else
{
char?choice;
while(1)
{
system(“cls“);
trymatch();
cin>>choice;
if(choice==‘n‘||choice==‘n‘)
break;
if(choice!=‘y‘?&&?choice!=‘Y‘?&&choice!=‘n‘?&&choice!=‘N‘)
cout<<“\n輸入錯誤請重新輸入“;
}
}

system(“pause“);
return?0;
}

void?trymatch()//手動輸入目標點匹配
{
cout<<“下面進行匹配試驗試驗結束后試驗結果會保存在與cpp同級的savetry.txt文件中:“< int?row0=0col0=0;
int?winsize;
cout<<“請輸入計算窗口大小,奇數,如7×7輸入7(建議不小于7):“;cin>>winsize;
while(1)
{
cout<<“下面輸入目標點像素坐標,鼠標點擊選擇(y)或手動輸入(n)?“< char?sele=‘y‘;cin>>sele;
if(sele==‘n‘)
{
cout<<“請輸入目標點的像素坐標(行,列):“<>row0;
????cout<<“列(不大于270):“;cin>>col0;cout< }
else
{
cout<<“下面進行鼠標點選按下鼠標左鍵選擇,選好后請按鍵盤任意鍵“< namedWindow(“select?object?point“);
void?MouseEvent(int?eventint?xint?yint?flagsvoid?*data);
setMouseCallback(“select?object?point“MouseEvent0);
imshow(“select?object?point“imgleft);waitKey(0);/*destroyWindow(“select?object?point“);*/
row0=selectobjp.x;col0=selectobjp.y;
}

????if(col0>270||col0(imgleft.rows-winsize/2-1)||col0>(imgleft.cols-winsize/2-1))
???cout<<“輸入目標點不符合要求請重新輸入:“;
el

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????113664??2018-05-06?14:10??Rmatch\Debug\Rmatch.exe

?????文件?????664252??2018-05-06?14:10??Rmatch\Debug\Rmatch.ilk

?????文件????2714624??2018-05-06?14:10??Rmatch\Debug\Rmatch.pdb

?????文件????3734016??2014-04-15?17:05??Rmatch\opencv庫\opencv_core249d.dll

?????文件?????470952??2014-04-15?17:05??Rmatch\opencv庫\opencv_core249d.lib

?????文件????3823616??2014-04-15?17:05??Rmatch\opencv庫\opencv_highgui249d.dll

?????文件?????142680??2014-04-15?17:05??Rmatch\opencv庫\opencv_highgui249d.lib

?????文件????3436032??2014-04-15?17:05??Rmatch\opencv庫\opencv_imgproc249d.dll

?????文件?????192618??2014-04-15?17:05??Rmatch\opencv庫\opencv_imgproc249d.lib

?????文件????????696??2018-05-06?14:37??Rmatch\Rmatch\Cornersleft.txt

?????文件????????699??2018-05-06?14:37??Rmatch\Rmatch\Cornersright.txt

?????文件???????3074??2018-05-06?14:10??Rmatch\Rmatch\Debug\cl.command.1.tlog

?????文件??????11542??2018-05-06?14:10??Rmatch\Rmatch\Debug\CL.read.1.tlog

?????文件????????846??2018-05-06?14:10??Rmatch\Rmatch\Debug\CL.write.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link-cvtres.read.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link-cvtres.write.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link-rc.read.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link-rc.write.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.1524-cvtres.read.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.1524-cvtres.write.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.1524-rc.read.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.1524-rc.write.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.1524.read.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.1524.write.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.15460-cvtres.read.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.15460-cvtres.write.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.15460-rc.read.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.15460-rc.write.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.15460.read.1.tlog

?????文件??????????2??2018-05-06?14:10??Rmatch\Rmatch\Debug\link.15460.write.1.tlog

............此處省略117個文件信息

評論

共有 條評論