remove depth and fix normal -> vnormal
This commit is contained in:
+8
-2
@@ -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. 键盘控制
|
||||
|
||||
Reference in New Issue
Block a user