Depth error in 2D image with OpenCV Python

前端 未结 3 808
無奈伤痛
無奈伤痛 2021-01-17 07:14

I am trying to compute the Canny Edges in an image (ndarray) using OpenCV with Python.

slice1 = slices[15,:,:]
slice1 = slice1[40:80,60:100]
print slice1.sha         


        
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-17 08:05

    Slice1 will need to be casted or created as a uint8. CV_8U is just an alias for the datatype uint8.

    import numpy as np
    slice1Copy = np.uint8(slice1)
    slicecanny = cv2.Canny(slice1Copy,1,100)
    

提交回复
热议问题