remove depth and fix normal -> vnormal

This commit is contained in:
bluepulsar
2025-12-28 18:52:55 +08:00
parent 6ec9eaa334
commit 4192683271
12 changed files with 54 additions and 60 deletions
+8 -2
View File
@@ -42,13 +42,19 @@ def main():
cv2.imshow("形变场 Deformation", arrows)
mag = np.sqrt(vnormal[:, :, 0]**2 + vnormal[:, :, 1]**2)
mag = gaussian_filter(mag, sigma=12)
mag_div = np.gradient(mag, axis=1) + np.gradient(mag, axis=0)
mag_div = np.where(mag_div>0, mag_div, 0)
mag_img = cv2.applyColorMap(
(mag/20 * 255.0).astype('uint8'),
(mag_div/0.2 * 255.0).astype('uint8'),
cv2.COLORMAP_JET
)
cv2.imshow("magnitude map", mag_img)
print(np.median(mag), np.min(mag), np.max(mag))
# print(np.median(mag), np.min(mag), np.max(mag))
print(np.median(mag_div), np.min(mag_div), np.max(mag_div))
# =====================================================================
# 4. 键盘控制