We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请提供下述完整信息以便快速定位问题 (Please provide the following information to quickly locate the problem)
系统环境/System Environment: macOS
使用的是哪门语言的程序/Which programing language: Python
所使用语言相关版本信息/Version: 3.10.13
OnnxRuntime版本/OnnxRuntime Version: 1.17.0
使用当前库的版本/Use version: rapidocr_onnxruntime==1.3.14
rapidocr_onnxruntime==1.3.14
可复现问题的demo和文件/Demo of reproducible problems:
import cv2 import numpy as np def cvt_four_to_three(img: np.ndarray) -> np.ndarray: """RGBA → BGR""" r, g, b, a = cv2.split(img) new_img = cv2.merge((b, g, r)) not_a = cv2.bitwise_not(a) not_a = cv2.cvtColor(not_a, cv2.COLOR_GRAY2BGR) new_img = cv2.bitwise_and(new_img, new_img, mask=a) new_img = cv2.add(new_img, not_a) return new_img img_path = "1.png" img = cv2.imread(img_path, cv2.IMREAD_UNCHANGED) res_img = cvt_four_to_three(img) cv2.imwrite("res.png", res_img) print("ok")
所用图像/ Use image: 1.png.zip
程序执行结果(注意下面有一张图,只不过是全白的): (Result (note that there is an image below, but it is completely white))
The text was updated successfully, but these errors were encountered:
Maybe a solution:
def cvt_four_to_three(img: np.ndarray) -> np.ndarray: """RGBA → BGR""" r, g, b, a = cv2.split(img) new_img = cv2.merge((b, g, r)) not_a = cv2.bitwise_not(a) not_a = cv2.cvtColor(not_a, cv2.COLOR_GRAY2BGR) new_img = cv2.bitwise_and(new_img, new_img, mask=a) mean_color = np.mean(new_img) if mean_color <= 0.0: new_img = cv2.add(new_img, not_a) else: new_img = cv2.bitwise_not(new_img) return new_img
Sorry, something went wrong.
Fixed issue #158
e388bd9
The issue has been fixed in rapidocr_onnxruntime>=1.3.15, rapidocr_openvino>=1.3.15 and rapidocr_paddle>=1.3.17.
rapidocr_onnxruntime>=1.3.15
rapidocr_openvino>=1.3.15
rapidocr_paddle>=1.3.17
SWHL
No branches or pull requests
请提供下述完整信息以便快速定位问题
(Please provide the following information to quickly locate the problem)
系统环境/System Environment: macOS
使用的是哪门语言的程序/Which programing language: Python
所使用语言相关版本信息/Version: 3.10.13
OnnxRuntime版本/OnnxRuntime Version: 1.17.0
使用当前库的版本/Use version:
rapidocr_onnxruntime==1.3.14
可复现问题的demo和文件/Demo of reproducible problems:
所用图像/ Use image:
1.png.zip
程序执行结果(注意下面有一张图,只不过是全白的):
(Result (note that there is an image below, but it is completely white))
The text was updated successfully, but these errors were encountered: