TypeError: Image data can not convert to float

前端 未结 12 723
醉话见心
醉话见心 2020-12-17 07:45

I am trying to create a 16-bit image like so:

import skimage 
import random
from random import randint                        
xrow=raw_input("Enter the          


        
12条回答
  •  春和景丽
    2020-12-17 08:18

    The error occurred when I unknowingly tried plotting the image path instead of the image.

    My code :

    import cv2 as cv
    from matplotlib import pyplot as plt
    import pytesseract
    from resizeimage import resizeimage
    
    img = cv.imread("D:\TemplateMatch\\fitting.png") ------>"THIS IS THE WRONG USAGE"
    #cv.rectangle(img,(29,2496),(604,2992),(255,0,0),5)
    plt.imshow(img)
    

    Correction: img = cv.imread("fitting.png") --->THIS IS THE RIGHT USAGE"

提交回复
热议问题