Files
cvpr/edge_detection.py
2023-01-25 12:25:59 +00:00

15 lines
530 B
Python

import os
import cv2
import numpy as np
import plotly.express as ex
if __name__ == '__main__':
img = np.load('/home/workspace/data/dataset/train/00042/uv_unposed_no_shape/Jumpsuit_58.npz')['uv_unposed_no_shape']
curv = np.load('/home/workspace/data/dataset/train/00042/curvature_uv/Jumpsuit_58.npz')['curvature_uv']
edges = cv2.Canny(image=(np.round((img+1) * 125)).astype(np.uint8), threshold1=25, threshold2=175, apertureSize=5, L2gradient=True)
ex.imshow(edges).show()
ex.imshow(curv).show()
print()