def move_vertex(self,vert_idx,new_pos):
"""
this fn is used to manipulate the surface boundary (coordinate system)
new_pos is in uv-space coords
if we move one vertex of the surface we need to find
the tranformation from old quadrangle to new quardangle
and apply that transformation to our marker uv-coords
"""
before = marker_corners_norm
after = before.copy()
after[vert_idx] = new_pos
transform = cv2.getPerspectiveTransform(after,before)
for m in self.markers.values():
m.uv_coords = cv2.perspectiveTransform(m.uv_coords,transform)
评论列表
文章目录