How did “people you might know” find you on social software>>>
In the original code
#read an image
img = cv2.imread('image.jpg')
#print the dimension of the image
print img.shape
It may be that the path is not set, so the returned type is none
The correct way is to write the path when reading the picture
#Try changing the direction of the slashes
im = cv2.imread("D:/testdata/some.tif",CV_LOAD_IMAGE_COLOR)
#or add r to the begining of the string
im = cv2.imread(r"D:\testdata\some.tif",CV_LOAD_IMAGE_COLOR)
Similar Posts:
- attributeError: ‘NoneType’ object has no attribute ‘shape’
- AttributeError: module ‘cv2’ has no attribute ‘CV_HAAR_SCALE_IMAGE’
- Image data type conversion uint8 and double in MATLAB
- Expected rbrace error encountered in DW
- How to Solve Libpng warning ICCP error
- Setting and Research on splash of unity startup interface (logo is too large and background is fuzzy)
- TypeError: Image data of dtype object cannot be converted to float
- Python OpenCV BUG: all the input arrays must have same number of dimensions
- [Solved] Tensorflow TypeError: Fetch argument array has invalid type ‘numpy.ndarry’
- [How to Solve] libpng warning: iCCP: known incorrect sRGB profile