cModules.PBRTiler.MathAlgorithms module

cModules.PBRTiler.MathAlgorithms module#

calculate_homography(source_pts, dest_pts)[source]#
Constructs the 8-parameter Homography matrix (H)
source_pts: [(u1, v1), (u2, v2), (u3, v3), (u4, v4)]
dest_pts: [(x1, y1), (x2, y2), (x3, y3), (x4, y4)]
Returns the mapping matrix transforming Dest to Source.
frankot_chellappa(np_normal_map)[source]#
Frankot-Chellappa algorithm to convert a Normal map to a Height map.
np_normal_map: numpy array shape (H, W, 3) in range [0, 1]
Returns: Height map numpy array shape (H, W) mapped roughly to [0, 1]
calculate_seam_energy_offset(luma_map)[source]#
Uses Phase Correlation / FFT to find optimal tiling offset.
luma_map: 2D array [0,1]
Returns optimal (dx, dy) offset (normalized 0..1)