I suggest you round the outer corners of every outer black (or white) square.
oh and opencv’s imread reads color as BGR, so your cvtColor is getting the wrong argument, but that doesn’t matter much here.
I get a result for these pictures:
why is this a problem? because you don’t have a border!
if there was a border, the outer corners wouldn’t be saddle points (where four squares meet), and the algorithm could properly ignore them.
curiously… this manually preprocessed image also gives me a (5,7) result. it’s merely a threshold (but not at 50% gray) plus removing part of the tripod on the bottom edge: