请求帮助,这个问题困扰我好久了,pytroch车牌识别

让做pytroch的车牌识别,我已经写不下去了
         pts1 = np.float32(vertices)
            pts2 = np.float32([[0, 0], [440, 0], [0, 140], [440, 140]])
            M = cv2.getPerspectiveTransform(pts1, pts2)
            dst = cv2.warpPerspective(imgg, M, (440, 140))
    img2 = cv2.cvtColor(dst, cv2.COLOR_BGR2GRAY)

显示的错误是:
Traceback (most recent call last):
File "D:/2022bishe/car_nn_demo-master/main.py", line 293, in
shishi = Car_pai() #车牌识别定位分割
File "D:/2022bishe/car_nn_demo-master/main.py", line 236, in init
img2 = cv2.cvtColor(dst, cv2.COLOR_BGR2GRAY)
UnboundLocalError: local variable 'dst' referenced before assignment

我上网找了一下说是用全局变量,在上面加global,但还是报错
希望可以正确解决

你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。