p1_t = np.transpose(p1_array)

print(f"p1_t:{p1_t}\nT:{T}")
p3 = np.matmul(T, p1_t)

print(f"p3: {p3}")

p3_t = np.transpose(p3)

print(f"p3_t: {p3_t}")


#----

center_point = (150,150)


# move origin to center point by subtracting cp for all point coords

print(">>>> test3")


p1_arr = p1_array.copy()

print(f"p1_arr: {p1_arr}")
p1_sub = p1_arr - np.array(center_point)

print(f"p1_sub: {p1_sub}")


p1_sub_t = np.transpose(p1_sub)

p1_rot_invt = np.matmul(T, p1_sub_t)

p1_rot = np.transpose(p1_rot_invt)


print(f"p1_rot: {p1_rot}")


# restore to original coord

p2 = p1_rot + np.array(center_point)

print(f"p2: {p2}")

img = blank_canvas.copy()
p2 = p2.tolist()
img = draw_point_list(img, p2)

savepath = os.path.join(outputdir, "test3_output.png")
cv2.imwrite(savepath, img)

Categories: Uncategorized

0 Comments

Leave a Reply

Your email address will not be published.