def __init__(self, blankBoard, fullBoard, InitialVerticesCount, blackThreshold, FinalVerticesCount=150, Offset=15):
self.INITIAL_VERTICES_COUNT = InitialVerticesCount
self.FINAL_VERTICES_COUNT = FinalVerticesCount
self.OFFSET = Offset
self.blackThreshold = blackThreshold
self.blankBoard = cv2.imread(blankBoard)
self.fullBoard = cv2.imread(fullBoard)
# get the edges from the images
self.blankBoardEdges = cv2.Canny(self.blankBoard, 0, 100)
self.fullBoardEdges = cv2.Canny(self.fullBoard, 0, 100)
# try to identify the four corners in the blankBoard
self.detectFourCorners(self.blankBoardEdges)
# process both the images
self.blankBoardMatrix = self.process(self.blankBoard, self.blankBoardEdges, self.blankName)
self.fullBoardMatrix = self.process(self.fullBoard, self.fullBoardEdges, self.fullName)
# fucntion to sharpen the image
评论列表
文章目录