Without this change, none of my chessboard images were recognized and even processing them did not work well. With this change, it works really well.
I tested it on the images from the robot cam at HU with very poor lighting conditions. See the images below.