#import required python modules
import cv2 # opencv
import pytesseract # tesseract
import matplotlib.pyplot as plt
import numpy as np
#read the text image using imread
org_img = cv2.imread("Poem.png")
plt.imshow(org_img) #display the read image
此代码有什么问题??我收到以下错误:“ 图像数据无法转换为浮点数>>”
<<org_img = cv2.imread("Poem.png")
org_img = cv2.cvtColor(org_img , cv2.COLOR_BGR2RGB)
plt.imshow(org_img)
plt.show()
这在Python / OpenCV中对我有用。您忘记在plt.show()
]之后添加plt.imshow(org_img)
#import required python modules import cv2 # opencv import pytesseract # tesseract import matplotlib.pyplot as plt import numpy as np #read the text image using imread org_img = cv2.imread("Poem.png") plt.imshow(org_img) #display the read image plt.show()
plt.show()
]之后添加plt.imshow(org_img)
#import required python modules
import cv2 # opencv
import pytesseract # tesseract
import matplotlib.pyplot as plt
import numpy as np
#read the text image using imread
org_img = cv2.imread("Poem.png")
plt.imshow(org_img) #display the read image
plt.show()