def saveCalibrationImage(i, imgset, dims):
 if len(imgset):
  lastcb = imgset[(-1)].findChessboard(dims, subpixel=False)
  thiscb = i.findChessboard(dims, subpixel=False)
  cbmid = (len(lastcb.coordinates()) / 2)
  if (distance(lastcb.coordinates()[cbmid], thiscb.coordinates()[cbmid]) < 30):
   showText(i, 'Move the chessboard around inside the green rectangle')
   return
 imgset.append(i.copy())
 global save_location
 if (not save_location):
  return
 filename = (((save_location + '_image') + str(len(imgset))) + '.png')
 imgset[(-1)].save(filename)

def saveCalibrationImage ( i , imgset , dims ) : if len ( imgset ) : lastcb = imgset [ ( - 1 ) ] . findChessboard ( dims , subpixel = False ) thiscb = i . findChessboard ( dims , subpixel = False ) cbmid = ( len ( lastcb . coordinates ( ) ) / 2 ) if ( distance ( lastcb . coordinates ( ) [ cbmid ] , thiscb . coordinates ( ) [ cbmid ] ) < 30 ) : showText ( i , 'Move the chessboard around inside the green rectangle' ) return imgset . append ( i . copy ( ) ) global save_location if ( not save_location ) : return filename = ( ( ( save_location + '_image' ) + str ( len ( imgset ) ) ) + '.png' ) imgset [ ( - 1 ) ] . save ( filename )
save our image in the calibration set .