MCPcopy Create free account
hub / github.com/AiuniAI/Unique3D / centered_crop

Function centered_crop

scripts/normal_to_height_map.py:100–110  ·  view source on GitHub ↗
(image: np.ndarray, target_resolution: Tuple[int, int])

Source from the content-addressed store, hash-verified

98
99
100def centered_crop(image: np.ndarray, target_resolution: Tuple[int, int]) -> np.ndarray:
101 return image[
102 (image.shape[0] - target_resolution[0])
103 // 2 : (image.shape[0] - target_resolution[0])
104 // 2
105 + target_resolution[0],
106 (image.shape[1] - target_resolution[1])
107 // 2 : (image.shape[1] - target_resolution[1])
108 // 2
109 + target_resolution[1],
110 ]
111
112
113def integrate_vector_field(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected