![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 54
高万禄
一个菜鸡
展开
-
2021 大学生电子设计竞赛 G题 无人机 识别部分
硬件解决方案前视OpenMV与下视OpenMVOpenMV代码仓库github: https://github.com/gaowanlu/electronic-design-competitionGithub开源仓库视觉ROI模型建立ROI模型图如 图表3所示,本项目采用视觉图像大小为 160*120(即宽为 160像素 高为120像素)。在图像中设计四个ROI区域,图表 3 ROI模型利用ROI模型设计识别算法当右上区域的内绿色色块的高大于右上区域高的二分之一,与宽度大于右上区域宽的原创 2021-11-19 21:17:26 · 10299 阅读 · 4 评论 -
机器学习-逻辑回归-sklearn
逻辑回归使用-sigmoid函数-进行对数几率回归(通常解决二分类问题)单特征from sklearn import datasetsimport numpy as npimport matplotlib.pyplot as pltiris = datasets.load_iris()list(iris.keys())X=iris["data"][:,3:] #petal width 花瓣宽度,选择每行的第四个(每行共四个)print(iris["target"])y=(iris["t原创 2021-02-13 23:53:44 · 420 阅读 · 0 评论 -
机器学习-学习曲线-sklearn
学习曲线如果模型在训练数据上表现良好,但根据交叉验证的指标泛化较差,则你的模型过拟合。如果两者的表现均不理想,则说明欠拟合均方误差 mean squared error训练测试分 train_test_splitfrom sklearn.metrics import mean_squared_errorfrom sklearn.model_selection import train_test_splitimport numpy as np import matplotlib.pyplot原创 2021-02-12 17:59:25 · 1191 阅读 · 0 评论 -
机器学习-线性回归-sklearn
线性模型Scikit-Learn中的线性回归from sklearn.linear_model import LinearRegressionimport numpy as npimport matplotlib as mplimport matplotlib.pyplot as plt#创建数据集X=2*np.random.rand(10,1)#100行1列的随机初始化向量y=4+3*X+np.random.randn(10,1)#创建模型实例lin_reg=LinearRegress原创 2021-02-10 21:49:24 · 702 阅读 · 0 评论 -
Python OpenCV
import cv2import numpy as np# test opencv """print(cv2.__version__)img=cv2.imread("1.png")cv2.imshow("output",img)"""# 获得灰度图像def get_Gray(img): return cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)#高斯滤波def get_gaussianBlur(img,size): return cv2.G原创 2021-01-24 20:34:23 · 323 阅读 · 2 评论 -
8-快速入门Python列表与map函数
#列表与map函数,好基友items=[ ("a",10), ("b",9), ("c",12)]it=[]for i in items: it.append(i[1])print(it)#it=[10,9,12]x=map(lambda item: item[1],items)#什么鬼?天知道。Python绝对不是对编码人员最友好的语言for item in x: print(item)#使用map函数同样实现了上面代码段实现的功能#lam原创 2020-12-22 22:19:46 · 240 阅读 · 0 评论 -
7-快速入门Python列表的查找与排序
#在列表中查找元素#.index()#查找首个这样的元素letter=[1,2,3,4,1,2]print(letter.index(2))#将会输出1,即返回了相应的下标#看一看列表中存不存在那样的元素letter=[1,2,3,4,5,6]if 4 in letter: print("have 4 in letter")if 7 in letter: print("have 7 in letter")#使用count()方法统计列表中有多少个这样的元素lett原创 2020-12-22 22:10:32 · 448 阅读 · 0 评论 -
7-快速入门Python初识数组的高级操作
#在Python中有许多好用的语法糖#取出元素numbers=[1,2,3]first,second,third=numbersprint(first,second,third)#非常nice#如果不想记忆这种语法,我们当然可以使用传统方法first=numbers[0]second=numbers[1]third=numbers[2]#更让人困惑的用法array=[1,2,3,4,5,6,7]first,second,*other=arrayprint(first,sec原创 2020-12-22 21:50:09 · 267 阅读 · 0 评论 -
6-快速入门Python初学数据结构
#下面我们开始学习Python中的数据结构#Python的强大在于它内置了许多使用方便的数据结构#遇见列表?#Python中的listarray=["a","b",12,545]#还能这样用,在Python中如JavaScript一切都是对象#对象是抽象的,这与C语言差着十万八千里。C语言中我们的严重都是内存#怎样输出列表?for obj in array: print(obj)#列表具有随机访问的性质,即他们的索引是连续的数字下标for i in range(4):原创 2020-12-21 23:03:48 · 234 阅读 · 0 评论 -
5-快速入门Python函数使用
#下面我们来快速入门Python中的怎样写出自己的函数#函数#参数 返回值 函数体#无参数def helloworld(): print("hello world")#调用helloworld()函数helloworld()#有参数的函数def name(name): print(name)#未知参数def future(*items): for item in items: print(item)#调用future函数futur原创 2020-12-20 00:47:09 · 243 阅读 · 1 评论 -
4-快速入门Python字符串的使用
#下面我们来快速学习Python中的字符串以及相关操作#打印字符串print("hello kitty")#bool string numbernumber_1=666number_2=888.888print(number_1+number_2)#将会输出1554.888judge=Falsejudge=True#Python动态解释型语言,其名称含义请在网上搜索进行查阅judge="hello world\n"print(judge)#关于 ' ' 与 " "到底原创 2020-12-20 00:37:30 · 263 阅读 · 1 评论 -
2-Python快速起步之数值计算
import math#在Python中有两种数,一种是整数一种是浮点数x=8y=2.2#数字的相关运算# + - * / % -= += /= *=print(x+y)print(x-y)print(x/y)print(x*y)print(x%y)#Python中的特别语法#指数运算print(2**3)# will print ,8#关于-= += /= *=对于有编程基础的学习者早已深刻在心中,此处不再描述#Python中的四舍五入操作print(round原创 2020-12-20 00:14:43 · 327 阅读 · 2 评论 -
3-从C++快速过渡到Python之控制流
#如何得到字符的ASCII码ascii_b=ord('b')ascii_B=ord('B')print(ascii_b)print(ascii_B)#他将会输出 98 66#开启条件判断的学习# > < >= <= == !=#示例print(3>4)#Falseprint(4>3)#True#使用if语句number = 11if number <11: print("number 小于 11")elif number=原创 2020-12-20 00:05:23 · 243 阅读 · 1 评论 -
1-开启Python之路
#使用print方法print("hello world")#我们打印10个hello worldprint("hello world"*10)#如果能换行就比较完美了print("\n")print("hello world\n"*10)#使用input方法#input的默认返回类型为str,即返回字符串number=input("这里填提示信息")#默认返回字符串类型,但我们需要的是数字怎么办?#使用强制转换大法#int(number)#float(number)#boo原创 2020-12-16 00:54:52 · 228 阅读 · 1 评论