def get_puzzle_pieces(self):
"""
returns the puzzle pieces, as well as their true locations in row major numbering format, as a dictionary,
where the key, is row_major puzzle_piece_id and the value is the piece image itself
:return: The dictionary of piece_id => piece_image
"""
result = dict()
for piece_id, piece in enumerate(self.tiles):
piece_image = np.array(piece.image)
result[piece_id] = rgb2gray(piece_image)
return result
评论列表
文章目录