Closed buloseshi closed 2 years ago
Solved, when generate pre-rendered alpha maps for stroke, crop_alpha_area(alpha) returns some one-dimensional vectors, and the judgment statement only determines whether it is empty or not. When the return is a one-dimensional vector, it will cause cv2.resize to report an error. The following code should be added to util_lib/gen_pams.py line 95
if alpha_crop.shape[1]==0: continue if alpha_crop.shape[0]==0: continue
Thank you for reporting the error, and fixing it. Now the code is updated.
generate pre-rendered alpha maps for stroke Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\derendering-text-master\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\ProgramData\Anaconda3\envs\derendering-text-master\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\mowe\Desktop\projects\derendering-text-master\util_lib\gen_pams.py", line 118, in
main()
File "C:\Users\mowe\Desktop\projects\derendering-text-master\util_lib\gen_pams.py", line 113, in main
gen_stroke_pams(char_dict)
File "C:\Users\mowe\Desktop\projects\derendering-text-master\util_lib\gen_pams.py", line 94, in gen_stroke_pams
alpha_crop = cv2.resize(
cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4052: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'