File "cc.py", line 54, in <module>
from visualization import *
File "/home/shilinzhe/Reweight-CC-master/visualization.py", line 9, in <module>
FONT = ImageFont.truetype(font='mono', size=24) #font='arial', size=24)
File "/home/shilinzhe/anaconda3/envs/reweight/lib/python3.8/site-packages/PIL/ImageFont.py", line 853, in truetype
return freetype(font)
File "/home/shilinzhe/anaconda3/envs/reweight/lib/python3.8/site-packages/PIL/ImageFont.py", line 850, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/shilinzhe/anaconda3/envs/reweight/lib/python3.8/site-packages/PIL/ImageFont.py", line 209, in __init__
self.font = core.getfont(
OSError: cannot open resource
https://blog.csdn.net/m0_37422289/article/details/81362959
open /usr/share/fonts/truetype , find a usable font
FONT = ImageFont.truetype(font='FreeMono', size=24) #font='arial', size=24)
找不到bgsegm
pip install opencv-contrib-python
Opencv ValueError: not enough values to unpack (expected 3, got 2)
原因是用的是Opencv4.0,把返回值从三个改回两个了
原代码:_,contours, hierarchy = cv2.findContours(img_gray, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
改为: contours, hierarchy = cv2.findContours(img_gray, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
pointPolygonTest
https://zhuanlan.zhihu.com/p/150202146?from_voters_page=true
SystemError: new style getargs format but argument is not a tuple
https://blog.csdn.net/weixin_44113645/article/details/85861296