# How to use findChessboardCornersSB with partially visible boards?

**URL:** <https://forum.opencv.org/t/how-to-use-findchessboardcornerssb-with-partially-visible-boards/11804>\
**Category:** Python\
**Tags:** calib3d\
**Created:** [January 29, 2023, 7:59pm UTC](https://forum.opencv.org/t/how-to-use-findchessboardcornerssb-with-partially-visible-boards/11804 "2023-01-29T19:59:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmnku](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tmnku](https://forum.opencv.org/u/tmnku)\
**Post date:** [January 29, 2023, 7:59pm UTC](https://forum.opencv.org/t/how-to-use-findchessboardcornerssb-with-partially-visible-boards/11804/1 "2023-01-29T19:59:17Z")

</div>

Hi, I’d like to detect partially visible Checkerboards using findChessboardCornersSB but the way I’m using it seems to be wrong even though I think I’m using it according to the documentation.  
The code I’m using for detection is

```auto
import cv2
img = cv2.imread('pattern.png')
ret, corners, meta = cv2.findChessboardCornersSBWithMeta(img, (9,4), cv2.CALIB_CB_LARGER + cv2.CALIB_CB_EXHAUSTIVE + cv2.CALIB_CB_NORMALIZE_IMAGE)
cv2.drawChessboardCorners(img, meta.shape[::-1], corners, ret)
cv2.imshow('img', img)
cv2.waitKey(0)

```

and I used this image as input

 ![pattern](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/8/8fee12f3d4e15df8d9dcd37139cd2aea78a6301e.png)  
When I draw the result it skips every second row thus returning the wrong corners. Sorry I cannot show an image here, since I’m new to the forum and I’m only allowed to upload one image.  
I noticed that the result for the given image is wrong only if I pass certain pattern sizes to the function (e.g. (9,4) as in this example) but works for other sizes like (3,3). In case of (3,3) it detects all visible corners in a 9x6 grid as I expected.  
Do I use this function the wrong way?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [January 29, 2023, 10:50pm UTC](https://forum.opencv.org/t/how-to-use-findchessboardcornerssb-with-partially-visible-boards/11804/2 "2023-01-29T22:50:00Z")

</div>

your board covers way too small an area of the image. with such pictures, you will have a very hard time accurately estimating the intrinsics.

OpenCV can’t handle partially occluded/invisible checkerboards. the corner detection isn’t the issue. associating found corners into a grid is the issue.

I have ideas on how to make regular checkerboards “detectable” even if they’re partially occluded/invisible, but not the free time and specific motivation.

if you need to handle partially occluded boards, you’ll need to use “charuco”, which is a different board type.

---

<div class="post-metadata">

**Author:** ![tmnku](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tmnku](https://forum.opencv.org/u/tmnku)\
**Post date:** [January 30, 2023, 8:24am UTC](https://forum.opencv.org/t/how-to-use-findchessboardcornerssb-with-partially-visible-boards/11804/3 "2023-01-30T08:24:08Z")

</div>

Thank you crackwitz. The image was just for testing purposes so I could see if it detects the partial board.

> OpenCV can’t handle partially occluded/invisible checkerboards. the corner detection isn’t the issue. associating found corners into a grid is the issue.

But isn’t the whole point of `findChessboardCornersSB` to find partial checkerboards? What else would the flag `CALIB_CB_LARGER` be used for then? Also the docu says

> In the case, the flags CALIB\_CB\_LARGER or CALIB\_CB\_MARKER are given, the result can be recovered from the optional meta array. Both flags are helpful to use calibration patterns exceeding the field of view of the camera.

I know about charuco but I’d prefer a traditional checkerboard since it can hold far more corners than a charuco board. That’s why I would prefer to make this approach work.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [January 31, 2023, 12:09am UTC](https://forum.opencv.org/t/how-to-use-findchessboardcornerssb-with-partially-visible-boards/11804/4 "2023-01-31T00:09:20Z")

</div>

> [@tmnku](#):
>
> In the case, the flags CALIB\_CB\_LARGER or CALIB\_CB\_MARKER are given

Oh, I missed that… haven’t done calibrations in a while and never actually dealt with the findChessboardCornersSB call. I’m out of ideas.
