PhotoImage显示问题:显示空白框,大小是图片的真实大小
原因:图像对象被回收了
解决办法:使用其他对象引用该对象即可(也可用于本项目全域引用,可被任意其他文件使用如list引用)
参考:https://blog.csdn.net/dekiven1/article/details/77508504
SyntaxWarning: name 'xxx' is assigned to before global declaration
tkinter在循环中创建按钮以传递命令参数无效
图像格式问题
将NumPy ndarray数据转换为PIL Image类型数据:img_pil = Image.fromarray(img_arr)
numpy.ndarray 转 image:数据类型dtype要求tf.uint8
参考:https://blog.csdn.net/discoverer100/article/details/102993264
参考:https://www.jianshu.com/p/e4ca58897b99
ValueError: Unknown resampling filter (107). Use Image.NEAREST (0), Image.LANCZOS >(1), Image.BIL
python-opencv旋转图像,保持图像不被裁减
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml
在pycharm中用plt打开图片使用plt.ginput()获取点击坐标失败
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 0 报错
原因:Python 编码中编码解码的问题,我这个错误就是‘utf-8’不能解码位置0的那个字节(0xa1),也就是这个字节超出了utf-8的表示范围了
解决办法:更换编码方式,如encoding='gb18030'
参考:https://blog.csdn.net/qq_41325698/article/details/101937198
error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
jupyter怎么使用pip install安装模块