- 博客(21)
- 收藏
- 关注
原创 Pycharm 找不到已安装的模块(未显示红色错误,一运行就报错) No module named x
解决 Pycharm 显示没有红色的错误。但是就是运行的时候,报错 No module named x
2023-02-25 05:00:34
3261
原创 解决 cannot import name ‘builder‘ from ‘google.protobuf.internal‘
解决 cannot import name 'builder' from 'google.protobuf.internal'
2023-02-25 04:40:32
7248
原创 python Process finished with exit code -1073741819 (0xC0000005) 解决
运行程序时,Process finished with exit code -1073741819 (0xC0000005) 报错原因:没有python33.dll 在c:\WINDOWS\system32\,也或许是有其他版本的 Python。检查你的 Python 路径最快的解决办法 重新装 pyhtonhttps://stackoverflow.com/questions/33582766/process-finished-with-exit-code-1073741515-0..
2022-02-21 19:53:26
5967
原创 Python 判断数据里有没有 NaN
def test(): a = [1,1,1,1,1,1,np.nan,1,1,1,1,1] b = np.isnan(a) print(b) if True in b: # 检查 b 里面有没有 True print("a has nan.") if __name__ == '__main__': test() 结果:[False False False False False False True False Fa.
2022-02-19 19:19:01
2121
原创 当 python Pip 升级失败
升级 Python2 的时候报错,查了好多资料都不行。用管理员模式强制升级解决了sudo su # in usr modulpip install --upgrade pippip -V
2022-02-18 23:10:42
224
原创 安装 Homebrew
1. 访问主页The Missing Package Manager for macOS (or Linux) — Homebrew,会告诉你在运行中输入什么来安装2. (比如MAC)在Terminal中输入: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"...
2022-02-18 22:37:07
272
原创 Opencv Mediapipe 人体追踪
import cv2import mediapipe as mpmp_drawing = mp.solutions.drawing_utilsmp_pose = mp.solutions.posedef video(): # cap = cv2.VideoCapture(0) # 用于摄像头追踪 cap = cv2.VideoCapture('') # 用于视频文件追踪# Setup mediapipe instance with mp_pose.Pose.
2022-02-16 13:56:39
2234
原创 Opencv cv2.KalmanFilter 鼠标跟踪
cv2.KalmanFilter 实现鼠标跟踪import cv2import numpy as npdef mousemove(event, x, y, s, p): # global frame, current_measurement, measurements, last_measurement, current_prediction, last_prediction # last_measurement = current_measurement
2022-02-16 13:46:58
1800
原创 Python, unsupported operand type(s) for *: ‘int‘ and ‘NoneType‘
File "<__array_function__ internals>", line 6, in dotTypeError: unsupported operand type(s) for *: 'NoneType' and 'int'使用dot时,左右两边类型不同,函数没有返回值,默认返回None一般出现:TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'。都是返回值为 None 了...
2022-02-16 05:15:38
3029
原创 python 读取npy文件
npy 文件用于存储重建ndarray 所需的数据、图形、dtype 和其他信息import numpy as npload_npy = np.load("path/XXX.npy")
2022-02-15 03:42:53
6954
1
原创 python List count()方法 list里面元素出现的次数
count() 统计某个元素在list中出现的次数list.count(obj)testlist = [123, 'abc', 'cdf', 'abc', 123, 123]print("Count for 123 : ", testlist.count(123)) print("Count for abc : ", testlist.count('abc'))结果Count for 123 : 3Count for abc : 2...
2022-02-15 03:39:58
756
原创 求两点之间距离 python
def distance(p1, p2): diff = math.sqrt(math.pow((p2[0] - p1[0]), 2) + math.pow((p2[1] - p1[1]), 2)) return diff
2022-02-15 03:25:45
630
原创 opencv RGB颜色
白色:rgb(255,255,255)黑色:rgb(0,0,0)红色:rgb(255,0,0)绿色:rgb(0,255,0)蓝色:rgb(0,0,255)青色:rgb(0,255,255)紫色:rgb(255,0,255)
2022-02-11 07:09:06
1169
原创 opencv CV2 读取视频信息
import cv2video_path = " "video_capture = cv2.VideoCapture(video_path)video_FourCC = int(video_capture.get(cv2.CAP_PROP_FOURCC))video_width = int(video_capture.get(3))video_height = int(video_capture.get(4))video_size = (int(video_capture.get(c.
2022-02-10 21:42:36
1285
原创 opencv cv2 视频延迟
场景:想要用 opencv 导入视频做运动监测遇到的问题:发现视频不是按源的帧数播放,而是变慢了错误原因: opencv的cap.read()会有一定的缓存,不是读的实时帧.尝试解决:1. OpenCV默认输出格式为YUYV,可将其改成MJPG格式。(未解决)...capture.open(1);//这里添加一行//OpenCV 2capture.set(CV_CAP_PROP_FOURCC, CV_FOURCC('M', 'J', 'P', 'G'));//or Open.
2022-02-10 05:59:06
9862
2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人