0

enter image description hereI tried to find the checker board corners using findcheckerboardcorners Opencv function. My pattern size is (7x7). It works fine when the image is parallel to camera, but when it is slightly tilted towards the ground it fails. Is it possible to give pattern size as (5x5) for (7x7)checkerboard pattern in the function?

Sample: It fails for image with more inclination. Image fails

It works for image Image with corners detected

Is there a possibility to get all the visible corners even when the image is inclined?

Community
  • 1
  • 1
Namrit
  • 11
  • 2
  • 2
    If you give another size to the algorithm then it will be ambiguous (which 5x5 points to take) and your calibration will be wrong afterwards. It could be that it get's confused with the light from the ceiling perhaps? can you draw the detected markers with `drawChessboardCorners` and post an image of it? to understand what is being detected and what not – api55 Aug 27 '18 at 12:28
  • I have uploaded my result in [link](http://namritt.blogspot.com/2018/08/blog-post.html) where it fails to detect for the secong image with 7x7 pattern size and for 5x5 pattern size both the image gets failed – Namrit Aug 27 '18 at 13:46
  • I can't open the image, the blog is not public. Please, use the edit button in your question to add the image. – api55 Aug 27 '18 at 13:58
  • See these answers: 1) https://stackoverflow.com/a/15074774/1435240 2) https://stackoverflow.com/a/12821056/1435240 – Francesco Callari Aug 28 '18 at 16:32

1 Answers1

-1

When you are choosing a calibration pattern, choose a pattern with more corners either in horizontal (8, 7) or vertical direction (7, 8).

There are different options which you can try to detect the checkerboard.

vector<Point2f> corners;
Size checkerBoardSize(7,7);
bool found = findCheckerBoard(img, checkerBoardSize, corners, CALIB_CB_SYMMETRIC_GRID);
if(!found)
    found = findCheckerBoard(img, checkerBoardSize, corners, CALIB_CB_SYMMETRIC_GRID | CALIB_CB_CLUSTERING);

//You can draw and see the detected points as follows
Mat res = img.clone();
if(res.channels() == 1)
    cvtColor(res, res, CV_GRAY2BGR);
drawChessboardCorners(res1, checkerBoardSize, corners, found);
imshow("res", res);
waitKey(0);
Dan Mašek
  • 17,852
  • 6
  • 57
  • 85
Gopiraj
  • 647
  • 7
  • 19
  • Thanks.. but i have problem in detecting the checker pattern which is inclined and not parallel to the camera. Where findChessboardCorners() function returns null – Namrit Aug 28 '18 at 04:17