10 2022 档案
摘要:A = [[0.5, 0.2, 0.3], [0.3, 0.5, 0.2], [0.2, 0.3, 0.5]]B = [[0.5, 0.5], [0.4, 0.6], [0.7, 0.3]]pi = [0.2, 0.4, 0.4]def a1(): t = 0 a = [] for i in ran
阅读全文
摘要:# 状态转移矩阵A = [[0.5, 0.2, 0.3], [0.3, 0.5, 0.2], [0.2, 0.3, 0.5]]# 观测概率矩阵B = [[0.5, 0.5], [0.4, 0.6], [0.7, 0.3]]# 观测序列pi = [0.2, 0.4, 0.4]def a1(): t =
阅读全文
摘要:import randomclass EM(): def __init__(self): # 设状态值概率 self.t = 0.6 self.q = 0.5 def E(self, i, j): pA = (self.t ** i) * ((1 - self.t) ** j) pB = (self
阅读全文
摘要:A = [[0.5, 0.2, 0.3], [0.3, 0.5, 0.2], [0.2, 0.3, 0.5]]B = [[0.5, 0.5], [0.4, 0.6], [0.7, 0.3]]pi = [0.2, 0.4, 0.4]a1 = [1, 1, 1]t = [0,0,1]def q(a1,t
阅读全文
摘要:参考来源:https://blog.csdn.net/qq_40828914/article/details/120895412 https://developer.aliyun.com/article/1003832 # 用socket实现一个简单的服务器,可以通过浏览器来访问import soc
阅读全文
摘要:参考来源:https://jingyan.baidu.com/article/9f7e7ec082aab12e2815549c.html 1,创建字符 2,魔法棒选中字符 3,图层栅格化 4,编辑描边 5,删除原图层 6,油漆桶填色
阅读全文
摘要:# 1,求观测序列的概率# 2,已知状态序列求观测序列# 3,已知观测序列求模型参数# 设状态值概率# pA=0.6# pB=0.5class EM(): def __init__(self): self.t = 0.6 self.q = 0.5 def E(self, i, j): pA = (s
阅读全文
摘要:#pyttsx3文字转语音import pyttsx3engine2 = pyttsx3.init()while True: content = input('请输入播放内容:') engine2.say(content) engine2.runAndWait() #文字转语音from win32c
阅读全文
摘要:import osimport cv2,reimport timeimport pyttsx3import ffmpegimport subprocessfrom PIL import Imageimport numpy as npimport imageioimageio.plugins.free
阅读全文
摘要:import cv2import mathpath = 'img_2.png'img = cv2.imread(path)pointList = []def mousePoint(event,x,y,flags,params): print(x,y) if event == cv2.EVENT_LB
阅读全文
摘要:import cv2import numpyimport pyzbarfrom pyzbar.pyzbar import decode#静态码识别# path = 'aa.jpg '# img = cv2.imread(path)# # from PIL import Image# # img =
阅读全文
摘要:import cv2import pytesseractpytesseract.pytesseract.tesseract_cmd=r'E:\tesseract\tesseract.exe'#字符识别(英文,数字)# img = cv2.imread('img_1.png')# img = cv2.
阅读全文
摘要:""" 从视频读取帧保存为图片"""import cv2import numpy as np# cap = cv2.VideoCapture('people.mp4')#读取文件cap = cv2.VideoCapture(0)#读取摄像头#皮肤检测def A(img): YCrCb = cv2.c
阅读全文
摘要:import cv2img = cv2.imread('img.png')def click_info(event, x, y, flags, param): # 只处理双击事件 if event == cv2.EVENT_LBUTTONDBLCLK: print('坐标', x, y) b, g,
阅读全文
摘要:invalid literal for int() with base 10 原因时因为int()不能将带有小数点的字符串转化为整数类型。
阅读全文
摘要:服务端import sockets = socket.socket()s.bind(('0.0.0.0',1234)) #主机ip,端口号s.listen() #等待连接c,addr = s.accept() #等待连接print(c)print(addr)客户端 import sockets =
阅读全文
摘要:import socket# 第一步 获取域名或ip地址host = 'www.baidu.com'port = 80header = b'GET / HTTP/1.1\r\nHost: www.baidu.com\r\nConnection: close\r\n\r\n'# 第二步 域名解析 将u
阅读全文
摘要:配合手写汉字识别系统使用 原数据集下载: http://www.nlpr.ia.ac.cn/databases/download/feature_data/HWDB1.1trn_gnt.zip http://www.nlpr.ia.ac.cn/databases/download/feature_d
阅读全文
摘要:import sysimport pygameimport random# 参数设置box_w, box_h = 10, 10 # 盒子宽高window_w, window_h = 400, 400x, y = 0,0#使用pygame之前必须初始化pygame.init()#设置主屏窗口scree
阅读全文
摘要:import randomimport sysimport pygame# 使用pygame之前必须初始化pygame.init()# 参数设置box_w, box_h = 5, 5 # 盒子宽高window_w, window_h = 400, 400x, y = 0, 0 #盒子起始点# 设置主
阅读全文