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

  • 大小: 351KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-10
  • 語(yǔ)言: 其他
  • 標(biāo)簽: opencv??opencv2??攝像頭??

資源簡(jiǎn)介

opencv 單目 攝像頭 標(biāo)定 帶圖片

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
//?OpenCV
#include?
#include?
#include?
#include?
using?namespace?std;
using?namespace?cv;

const?int?imageWidth?=?640; //攝像頭的分辨率
const?int?imageHeight?=?480;
const?int?boardWidth?=?5; //橫向的角點(diǎn)數(shù)目
const?int?boardHeight?=?4; //縱向的角點(diǎn)數(shù)據(jù)
const?int?boardCorner?=?boardWidth?*?boardHeight; //總的角點(diǎn)數(shù)據(jù)
const?int?frameNumber?=?12; //相機(jī)標(biāo)定時(shí)需要采用的圖像幀數(shù)
const?int?squareSize?=?20; //標(biāo)定板黑白格子的大小?單位mm
const?Size?boardSize?=?Size(boardWidth?boardHeight); //

Mat?intrinsic; //相機(jī)內(nèi)參數(shù)
Mat?distortion_coeff; //相機(jī)畸變參數(shù)
vector?rvecs; ????//旋轉(zhuǎn)向量
vector?tvecs; //平移向量
vector>?corners; //各個(gè)圖像找到的角點(diǎn)的集合?和objRealPoint?一一對(duì)應(yīng)
vector>?objRealPoint; //各副圖像的角點(diǎn)的實(shí)際物理坐標(biāo)集合


vector?corner; //某一副圖像找到的角點(diǎn)

Mat?rgbImage?grayImage;

/*計(jì)算標(biāo)定板上模塊的實(shí)際物理坐標(biāo)*/
void?calRealPoint(vector>&?obj?int?boardwidthint?boardheight?int?imgNumber?int?squaresize)
{
// Mat?imgpoint(boardheight?boardwidth?CV_32FC3Scalar(000));
vector?imgpoint;
for?(int?rowIndex?=?0;?rowIndex? {
for?(int?colIndex?=?0;?colIndex? {
// imgpoint.at(rowIndex?colIndex)?=?Vec3f(rowIndex?*?squaresize?colIndex*squaresize?0);
imgpoint.push_back(Point3f(rowIndex?*?squaresize?colIndex?*?squaresize?0));
}
}
for?(int?imgIndex?=?0;?imgIndex? {
obj.push_back(imgpoint);
}
}

/*設(shè)置相機(jī)的初始參數(shù)?也可以不估計(jì)*/
void?guessCameraParam(void?)
{
/*分配內(nèi)存*/
intrinsic.create(3?3?CV_64FC1);
distortion_coeff.create(5?1?CV_64FC1);

/*
fx?0?cx
0?fy?cy
0?0??1
*/
intrinsic.at(00)?=?256.8093262;???//fx
intrinsic.at(0?2)?=?160.2826538;???//cx
intrinsic.at(1?1)?=?254.7511139;???//fy
intrinsic.at(1?2)?=?127.6264572;???//cy

intrinsic.at(0?1)?=?0;
intrinsic.at(1?0)?=?0;
intrinsic.at(2?0)?=?0;
intrinsic.at(2?1)?=?0;
intrinsic.at(2?2)?=?1;

/*
k1?k2?p1?p2?p3
*/
distortion_coeff.at(0?0)?=?-0.193740;??//k1
distortion_coeff.at(1?0)?=?-0.378588;??//k2
distortion_coeff.at(2?0)?=?0.028980;???//p1
distortion_coeff.at(3?0)?=?0.008136;???//p2
distortion_coeff.at(4?0)?=?0; ??//p3
}

void?outputCameraParam(void?)
{
/*保存數(shù)據(jù)*/
//cvSave(“cameraMatrix.xml“?&intrinsic);
//cvSave(“cameraDistoration.xml“?&distortion_coeff);
//cvSave(“rotatoVector.xml“?&rvecs);
//cvSave(“translationVector.xml“?&tvecs);
/*輸出數(shù)據(jù)*/
cout?<(0?0)?<(1?1)?< cout?<(0?2)?<(1?2)?<
cout?<

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件??????28542??2009-11-06?19:34??03.jpg

?????文件??????30202??2009-11-06?19:34??04.jpg

?????文件??????29695??2009-11-06?19:34??05.jpg

?????文件??????25192??2009-11-06?19:34??06.jpg

?????文件??????26076??2009-11-06?19:35??07.jpg

?????文件??????33800??2009-11-06?19:35??08.jpg

?????文件??????33484??2009-11-06?19:35??09.jpg

?????文件??????32192??2009-11-06?19:36??10.jpg

?????文件??????35004??2009-11-06?19:37??11.jpg

?????文件??????33999??2009-11-06?19:38??12.jpg

?????文件???????6062??2016-05-23?21:49??CalibrationOpenCV3.cpp

?????文件??????28056??2009-11-06?19:33??01.jpg

?????文件??????26742??2009-11-06?19:33??02.jpg

-----------?---------??----------?-----??----

???????????????369046????????????????????13


評(píng)論

共有 條評(píng)論

相關(guān)資源