This is a program, no problem, basic can run online to find the chessboard figure, but you take the board pictures why undetectable corner?
# include
# include
using namespace std;
Using the namespace CV;
Int main ()
{
Mat srcimage;
Mat viewGray;
VectorThe Size PatSize;
PatSize. Width=9;
PatSize. Height=6;
Srcimage=imread (" C:/Users/ASUS/Desktop/project/new folder/1/SAN Antonio pg ");
CvtColor (srcimage viewGray, COLOR_BGR2GRAY);
Bool ret=findChessboardCorners (viewGray PatSize, corners).
if (! Ret)
{
Cout & lt; <"Can not find the corners." & lt; }
CornerSubPix (viewGray, corners, the Size (11, 11),
The Size (1, 1), TermCriteria (EPS + TermCriteria TermCriteria: : : : COUNT, 40, 0.04));
DrawChessboardCorners (srcimage PatSize, Mat (corners), ret);
NamedWindow (" chessboard corners ");
Imshow (" chessboard corners, "srcimage);
WaitKey (0);
}
CodePudding user response:
PatSize. Width=8
Have a try CodePudding user response: