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

后端 未结 11 1346
故里飘歌
故里飘歌 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:05

    Is canny your own function? Do you use Canny from OpenCV inside it? If yes check if you feed suitable argument for Canny - first Canny argument should meet following criteria:

    • type:
    • dtype: dtype('uint8')
    • being single channel or simplyfing: grayscale, that is 2D array, i.e. its shape should be 2-tuple of ints (tuple containing exactly 2 integers)

    You can check it by printing respectively

    type(variable_name)
    variable_name.dtype
    variable_name.shape
    

    Replace variable_name with name of variable you feed as first argument to Canny.

提交回复
热议问题