This forum is disabled, please visit https://forum.opencv.org

1 | initial version |

The problem is almost certainly that your object points are incorrect. What you've done is symmetric grid (like a chessboard) which assumes the same number of grid points per row. The asymmetric pattern doesn't. You can try (converted straight from the C++):

```
objectPoints= []
grid_size = 0.03 # 3cm, or whatever
rows, cols = 4, 11
for i in range(rows):
for j in range(cols):
objectPoints.append( ((2*j + i%2)*grid_size, i*grid_size, 0) )
objectPoints= np.array(corners).astype('float32')
```

I'm posting this as a late answer, for folks coming from Google.

2 | Suggested edit |

The problem is almost certainly that your object points are incorrect. What you've done is symmetric grid (like a chessboard) which assumes the same number of grid points per row. The asymmetric pattern doesn't. You can try (converted straight from the C++):

```
objectPoints= []
grid_size = 0.03 # 3cm, or whatever
rows, cols = 4, 11
for i in
```~~range(rows):
~~range(cols):
for j in ~~range(cols):
~~range(rows):
objectPoints.append( i*grid_size, ((2*j + i%2)*grid_size, ~~i*grid_size, ~~, 0) )
objectPoints= ~~np.array(corners).astype('float32')
~~np.array(objectPoints).astype('float32')

I'm posting this as a late answer, for folks coming from Google.

3 | Suggested edit |

The problem is almost certainly that your object points are incorrect. What you've done is symmetric grid (like a chessboard) which assumes the same number of grid points per row. The asymmetric pattern doesn't. You can try (converted straight from the C++):

```
objectPoints= []
grid_size = 0.03 # 3cm, or whatever
rows, cols = 4, 11
for i in range(cols):
for j in range(rows):
objectPoints.append(
```~~i*grid_size, ((2*j ~~(i*grid_size, (2*j + i%2)*grid_size, ~~, ~~0) )
objectPoints= np.array(objectPoints).astype('float32')

I'm posting this as a late answer, for folks coming from Google.

4 | No.4 Revision |

I'm posting this as a late answer, for folks coming from Google.

The problem is almost certainly that your object points are incorrect. What you've done is symmetric grid (like a chessboard) which assumes the same number of grid points per row. The asymmetric pattern doesn't. ~~You can try (converted straight ~~This code is adapted from the ~~C++):~~C++ source. It's worth plotting your object points to double check that it actually looks like your pattern:

```
objectPoints= []
grid_size = 0.03 # 3cm, or whatever
rows, cols = 4, 11
for i in range(cols):
for j in range(rows):
objectPoints.append( (i*grid_size, (2*j + i%2)*grid_size, 0) )
objectPoints= np.array(objectPoints).astype('float32')
scatter(objectPoints[:,0], objectPoints[:,1])
```

~~I'm posting this ~~Note that the rows are staggered in the pattern, that's where the asymmetry comes from. The `grid_size`

is the x-spacing between the circles. The loop plots a 4x11 grid, but shifts alternate columns down by `grid_size`

. Here's a plot of the pattern as ~~a late answer, for folks coming from Google.~~generated:

Copyright OpenCV foundation, 2012-2018. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.