摄像头标定程序用于标定多幅棋盘图像

摄像头标定程序用于标定多幅棋盘图像

ID:35341827

大小:84.87 KB

页数:9页

时间:2019-03-23

摄像头标定程序用于标定多幅棋盘图像_第1页
摄像头标定程序用于标定多幅棋盘图像_第2页
摄像头标定程序用于标定多幅棋盘图像_第3页
摄像头标定程序用于标定多幅棋盘图像_第4页
摄像头标定程序用于标定多幅棋盘图像_第5页
资源描述:

《摄像头标定程序用于标定多幅棋盘图像》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、//#includenstdafx.hn#include#include#inelude//OpenCV#include#include#include#ineludevoidInitCorners3D(CvMat*Comers3D,CvSizeChessBoardSize,intNimages,floatSquareSize);voidmakeChessBoard();intmyFindChessboardCorners(constvo

2、id*image,CvSizepattern_size,CvPoint2D32f*corners,int*comer_count=NULL,intflags=CV_CALIB_CB_ADAPTIVE_THRESH);inlineintdrawCorssMark(IplImage*dst,CvPointpt)/•上•上•上•丄••匕*1*•匕•匕*1*•匕■匕•匕•匕■匕•匕■立•匕/彳.彳.彳.彳.彳.Function:Description:Qills:CalledBy:Input:Output:Return:Others:main」oop绘制一个十字标记RGBi

3、mage,pt需要检查坐标是否越界todolist•丄■•土•丄■•丄■•丄■•土•丄■*4*•丄■•丄■•丄■*4*•丄■*4*•丄■*4*•丄■•卜•丄■*4*•丄■•卜•丄■•丄■•丄■•丄■/^7^^7^#T>jconstintcross_len=4;CvPointptl,pt2,pt3,pt4;ptl.x=pt.x;ptl.y=pt.y-crossJen;pt2.x=pt.x;pt2.y=pt.y+cross_len;pt3.x=pt.x-cross_len;pt3.y=pt.y;pt4.x=pt.x+crossJen;pt4.y=pt.y;cvLi

4、ne(dst,ptl,pt2,CV_RGB(0,255,0)2CV_AA,0);cvLine(dst,pt3,pt4,CV_RGB(0,255,0),2,CV_AA,0);return0;intThresholdness=120;intimage_width=640;//320;intimage_height=480;//240;boolverbose=false;constintChessBoardSize_w=7;constintChessBoardSize_h=7;//Calibrationstuffboolcalibration_done=false;con

5、stCvSizeChessBoardSize=cvSize(ChessBoardSize_w,ChessBoardSize_h);//floatfloatSquareWidth=21.6f;〃实际距离毫米单位在A4纸上为两厘米SquareWidth=17;//投影实际距离毫米单位200constintNPoints=ChessBoardSize_w*ChessBoardSize_h;constintNImages=10;//NumberofimagestocollectCvPoint2D32fcorners[NPoints*NImages];intcorner_co

6、unt[NImages]={0};intcaptured_frames=0;CvMat*intrinsics;CvMat*distortion_coeff;CvMat*rotation_vectors;CvMat*translation_vectors;CvMat*object_points;CvMat*point_counts;CvMat*image_points;intfind_corners_result=0;voidon_mouse(intevent,intx,inty,intflags,void*param)if(event==CV_EVENT_LBUTT

7、ONDOWN){//calibration_done=true;}}intmain(intargc,char*argv[])CvFontfont;inti;charfilename[100J;cvInitFont(&fon「CV_FONT_VECTORO,5,5,0,7,8);intrinsics=cvCreateMat(3,3,CV_32FC1);distortion_coeff=cvCreateMat(l,4,CV_32FC1);rotation_vectors=cvCreateMat(NImages,3,CV_32FC1);translation_vect

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。