xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 20.77MB
    文件類型: .7z
    金幣: 1
    下載: 0 次
    發布日期: 2023-08-02
  • 語言: 其他
  • 標簽: 相機標定??

資源簡介

opencv相機標定,加上圖像坐標到世界坐標的轉化

資源截圖

代碼片段和文件信息


//#include???
//#include???
//#include?“cv.h“??
//#include???
//#include???
//#include??
//#include?“atlstr.h“?

#include?“opencv2/core/core.hpp“
#include?“opencv2/imgproc/imgproc.hpp“
#include?“opencv2/calib3d/calib3d.hpp“
#include?“opencv2/highgui/highgui.hpp“
#include?
#include?

using?namespace?std;
using?namespace?cv;

const?int?imageWidth?=?1600;?????????????????????????????//攝像頭的分辨率??
const?int?imageHeight?=?1200;
const?int?boardWidth?=?7;???????????????????????????????//橫向的角點數目??
const?int?boardHeight?=?7;??????????????????????????????//縱向的角點數據??
const?int?boardCorner?=?boardWidth?*?boardHeight;???????//總的角點數據??
const?int?frameNumber?=13;?????????????????????????????//相機標定時需要采用的圖像幀數??
const?int?squareSize?=?20;??????????????????????????????//標定板黑白格子的大小?單位mm??
const?Size?boardSize?=?Size(boardWidth?boardHeight);???//??

Mat?intrinsic;??????????????????????????????????????????//相機內參數??
Mat?distortion_coeff;???????????????????????????????????//相機畸變參數??
vector?rvecs;????????????????????????????????????????//旋轉向量??
vector?tvecs;????????????????????????????????????????//平移向量??
vector>?corners;????????????????????????//各個圖像找到的角點的集合?和objRealPoint?一一對應??
vector>?objRealPoint;???????????????????//各副圖像的角點的實際物理坐標集合??


vector?corner;???????????????????????????????????//某一副圖像找到的角點??

Mat?rgbImage?grayImage;

/*計算標定板上模塊的實際物理坐標*/
void?calRealPoint(vector>&?obj?int?boardwidth?int?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(colIndex?*?squaresize?rowIndex?*?squaresize?0));
}
}
for?(int?imgIndex?=?0;?imgIndex? {
obj.push_back(imgpoint);
}
}

/*設置相機的初始參數?也可以不估計*/

void?CalibrationEvaluate(void)//標定結束后進行評價
{
double?err=0;
double?total_err=0;
//calibrateCamera(objRealPoint?corners?Size(imageWidth?imageHeight)?intrinsic?distortion_coeff?rvecs?tvecs?0);
cout?< for?(int?i?=?0;?i? {
vector?image_points2;
vector?tempPointSet?=?objRealPoint[i];
projectPoints(tempPointSet?rvecs[i]?tvecs[i]?intrinsic?distortion_coeff?image_points2);




vector?tempImagePoint?=?corners[i];
Mat?tempImagePointMat?=?Mat(1?tempImagePoint.size()?CV_32FC2);
Mat?image_points2Mat?=?Mat(1?image_points2.size()?CV_32FC2);
for?(int?j?=?0;?j? {
image_points2Mat.at(0?j)?=?Vec2f(image_points2[j].x?image_points2[j].y);
tempImagePointM

評論

共有 條評論