IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
|
Functions | |
def | calibrate_real_puzzle (theImageMea, thePrevImage=None, theCalibrated=None, params=ParamPuzzle, option=1, verbose=False) |
def | calibrate_real_puzzle_sequence (img_folder, option, fsize=1, verbose=False) |
def | create_synthetic_puzzle (theImageSol, theMaskSol_src, explodeDis=(200, 200), moveDis=(2000, 100), rotateRange=70, ROTATION_ENABLED=True, verbose=False) |
Variables | |
cpath = fpath.rsplit('/', 1)[0] | |
fpath = os.path.realpath(__file__) | |
def puzzle.utils.puzzleProcessing.calibrate_real_puzzle | ( | theImageMea, | |
thePrevImage = None , |
|||
theCalibrated = None , |
|||
params = ParamPuzzle , |
|||
option = 1 , |
|||
verbose = False |
|||
) |
@brief To obtain the solution board or the pieces in the solution area. Args: theImageMea: The input image. thePrevImage: The pre-saved image of last frame. theCalibrated: Load a pre-saved board, otherwise create an empty one. params: Parameter settings to extract the pieces. option: The option 0 is to assemble the puzzle while option 1 is to disassemble the puzzle verbose: Whether to debug Returns: thePrevImage: The updated previous image. theCalibrated: A board of calibrated pieces.
def puzzle.utils.puzzleProcessing.calibrate_real_puzzle_sequence | ( | img_folder, | |
option, | |||
fsize = 1 , |
|||
verbose = False |
|||
) |
@brief To obtain the solution board from an image sequence for calibration. Args: img_folder: The path to the image folder. We assume the image name like XX_0.png option: The option 0 is to assemble the puzzle while option 1 is to disassemble the puzzle fsize: The scale to resize the input image. verbose: Whether to debug Returns: theCalibrated: A board of calibrated pieces
def puzzle.utils.puzzleProcessing.create_synthetic_puzzle | ( | theImageSol, | |
theMaskSol_src, | |||
explodeDis = (200,200) , |
|||
moveDis = (2000,100) , |
|||
rotateRange = 70 , |
|||
ROTATION_ENABLED = True , |
|||
verbose = False |
|||
) |
@brief create a synthetic/exploded/rotated measured board & solution board from a foreground image & background image. Args: theImageSol: The source RGB image. theMaskSol_src: The source template image. explodeDis: The exploded distance setting, (xx,yy). moveDis: The moved distance setting, (xx,yy). rotateRange: The range of the rotation. ROTATION_ENABLED: The flag signifying rotation option. verbose: The flag signifying debug or not. Returns: theGridMea: The measured board. theGridSol: The solution board. gt_pAssignments: The ground truth assignments.
cpath = fpath.rsplit('/', 1)[0] |
fpath = os.path.realpath(__file__) |