Deep learning/영상처리1 rotation matrix python 회전 행렬 변환 구현 rotation matrix python 회전 행렬 변환 구현 def calc_rotate( x,y,degree=45): rad = degree * (math.pi / 180.0) nx = round(math.cos(rad) * x - math.sin(rad) * y) ny = round(math.sin(rad) * x + math.cos(rad) * y) return nx, ny def Ccalc_rotate( x,y,img_cx,img_cy,theta=45): new_x = (x - img_cx ) * cos(radians(360-theta)) - (y - img_cy) * sin(radians(360-theta)) + img_cx new_y = (x - img_cx) * sin(radians(360.. 2023. 11. 7. 이전 1 다음 반응형