用来做双目或者单目的标定和校正,opencv实现
static int board() {
int width = 210;//棋盘格宽度
int height = 210;//棋盘格高度
int x_num = 6;//角点数目
int y_num = 9;//角点数目
IplImage *src = cvCreateImage(cvSize(width*(x_num + 1, height*(y_num + 1)), IPL_DEPTH_8U, 1);
cvZero(src);
for (int i = 0; i<src->height; i++)
{
for (int j = 0; j<src->width; j++)
{
if ((i / width + j / height) % 2 == 0)
{
src->imageData[i*src->widthStep + j*src->nChannels] = 255;
}
}
}
cvNamedWindow("src");
cvShowImage("src", src);
cvSaveImage("ChessBoard.bmp", src, 0);
cvWaitKey(0);
return 0;
}