目录
车头朝向一起变化
import cv2
import numpy as np
def world_to_pixel(world_x, world_y, img_w=800, img_h=800):
scale_x = img_w / 120 # 横向范围:0~120米
scale_y = img_h / 80 # 纵向范围:0~80米
pixel_x = int(world_x * scale_x)
pixel_y = img_h - int(world_y * scale_y) # OpenCV坐标系Y轴向下
return (pixel_x, pixel_y)
def draw_rotated_rect(img, center, size, angl