heightmap_interpolation.inpainting.fd_pde_inpainter module
- class heightmap_interpolation.inpainting.fd_pde_inpainter.FDPDEInpainter(**kwargs)
Bases:
abc.ABCAbstract base class for Finite-Differences Partial Differential Equation (FDPDE) Inpainters
Common interphase for PDE-based inpainting methods. Solves the problem using finite differences in a gradient-descent manner.
- dt
Gradient descent step size.
- Type
float
- rel_change_iters
Check the relative change between iterations of the optimizer every this number of iterations.
- Type
int
- rel_change_tolerance
Stop the optimization when the energy descent between iterations is less than
- Type
float
- max_iters
Maximum number of iterations for the optimizer.
- Type
int
- relaxation
Over-relaxation parameter. It is still under testing, use with care.
- Type
float
- mgs_levels
Number of levels of detail to use in the Mult-Grid Solver (MGS). Setting it to 1 deactivates the MGS.
- Type
int
- mgs_min_res
minimum resolution (width or height) allowed for a level in the MGS. If the level of detail in the pyramid gets to a value lower than this, the pyramid construction will stop.
- Type
int
- print_progress
Print information about the progress of the optimization on screen.
- Type
bool
- print_progress_iters
If print_progress==True, the information will be printed every this number of iterations.
- Type
int
- init_with
initializer for the unknown data before applying the optimization.
- Type
str
- convolver_type
the convolver used for all the convolutions required by the solver.
- Type
str
- debug_dir
a debug directory where the intermediate steps will be rendered. Useful to create a video of the evolution of the solver.
- Type
str
- fast_norm(vector)
- get_config()
- get_decimal_places(number)
- inpaint(image, mask)
- inpaint_grid(image, mask)
- inpaint_multigrid(image, mask)
Multigrid solver for inpainting problems.
- Parameters
img – input image to be inpainted
mask – logical mask of the same size as the input image. True == known pixels, False == unknown pixels to be inpainted
- Returns
inpainted image
- print_end()
- print_msg(msg)
- print_start(msg)
- abstract step_fun(f, mask)