OpenCV TypeError: Expected cv::UMat for argument 'src' - What is this?

后端 未结 11 1397
故里飘歌
故里飘歌 2020-12-01 15:44

Disclaimer: huge openCV noob

Traceback (most recent call last):

File \"lanes2.py\", line 22, in

canny = canny(lane_image)         


        
11条回答
  •  广开言路
    2020-12-01 16:20

    Not your code is the problem this is perfectly fine:

    gray = cv2.cvtColor(imgUMat, cv2.COLOR_RGB2GRAY)
    

    The problem is that imgUMat is None so you probably made a mistake when loading your image:

    imgUMat = cv2.imread("your_image.jpg")
    

    I suspect you just entered the wrong image path.

提交回复
热议问题