当前位置: 首页 > news >正文

如何创建自己的网站平台做网站的项目职责怎么写

如何创建自己的网站平台,做网站的项目职责怎么写,拌合站建站方案,ui设计网页设计培训import cv2 as cv import os import numpy as np# 遍历文件夹函数 def getFileList(dir, Filelist, extNone):"""获取文件夹及其子文件夹中文件列表输入 dir:文件夹根目录输入 ext: 扩展名返回: 文件路径列表"""newDir d…

import cv2 as cv
import os
import numpy as np# 遍历文件夹函数
def getFileList(dir, Filelist, ext=None):"""获取文件夹及其子文件夹中文件列表输入 dir:文件夹根目录输入 ext: 扩展名返回: 文件路径列表"""newDir = dirif os.path.isfile(dir):if ext is None:Filelist.append(dir)else:if ext in dir[-3:]:Filelist.append(dir)elif os.path.isdir(dir):for s in os.listdir(dir):newDir = os.path.join(dir, s)getFileList(newDir, Filelist, ext)return Filelistdef mid(follow, mask):halfWidth= follow.shape[1] // 2half = halfWidth  # 从下往上扫描赛道,最下端取图片中线为分割线for y in range(follow.shape[0] - 1, -1, -1):# V2改动:加入分割线左右各半张图片的宽度作为约束,减小邻近赛道的干扰if (mask[y][max(0,half-halfWidth):half] == np.zeros_like(mask[y][max(0,half-halfWidth):half])).all():  # 分割线左端无赛道left = max(0,half-halfWidth)  # 取图片左边界else:left = np.average(np.where(mask[y][0:half] == 255))  # 计算分割线左端平均位置if (mask[y][half:min(follow.shape[1],half+halfWidth)] == np.zeros_like(mask[y][half:min(follow.shape[1],half+halfWidth)])).all():  # 分割线右端无赛道right = min(follow.shape[1],half+halfWidth)  # 取图片右边界else:right = np.average(np.where(mask[y][half:follow.shape[1]] == 255)) + half  # 计算分割线右端平均位置mid = (left + right) // 2  # 计算拟合中点half = int(mid)  # 递归,从下往上确定分割线follow[y, int(mid)] = 255  # 画出拟合中线if y == 360:  # 设置指定提取中点的纵轴位置mid_output = int(mid)cv.circle(follow, (mid_output, 360), 5, 255, -1)  # opencv为(x,y),画出指定提取中点error = follow.shape[1] // 2 - mid_output  # 计算图片中点与指定提取中点的误差return follow, error  # error为正数右转,为负数左转n = -1
# 存放图片的文件夹路径
path = "./phone"
imglist = getFileList(path, [])
for imgpath in imglist:n += 1if n < 0:continueimg = cv.imread(imgpath)img = cv.resize(img,(640,480))# HSV阈值分割img_hsv = cv.cvtColor(img, cv.COLOR_BGR2HSV)mask = cv.inRange(img_hsv, np.array([43, 60, 90]), np.array([62, 255, 255]))follow = mask.copy()follow, error = mid(follow, mask)print(n, f"error:{error}")cv.imshow("img", img)cv.imshow("mask", mask)cv.imshow("follow", follow)cv.waitKey(0)cv.destroyAllWindows()

 

http://www.yayakq.cn/news/119699/

相关文章:

  • 机械类网站如何做网站优化景安网络网站建设
  • 深圳外贸网站制作jsp asp php哪个做网站
  • 谷歌网站站长指南怎么做好seo推广
  • 社交网站的优点和缺点高端终端网站设计类网站
  • 网站设计名称wordpress设置html代码高亮
  • 网站建设三方合同范本微商营销软件商城
  • 潮阳网站制作wordpress之家
  • 微网站自定义脚本wordpress删除多余图片
  • 免费学服装设计的网站长春网站建设的公司
  • 广州网站开发服务校园网二级网站的建设
  • 海外建站流程视觉冲击力的网站设计
  • 铭做网站建设阿里营销网站建设
  • 钟情建网站公司同学录wordpress
  • 郑州餐饮网站建设哪家好教育类网页设计素材
  • 宁波建网站哪家值得信赖中国万网域名查询
  • flash做安卓游戏下载网站互联网开网站怎么做
  • 有哪些好的模板网站做网站的收益来源
  • 遵义祥云平台网站建设衡水做阿里巴巴网站
  • seo站长工具推广平台深圳店铺设计
  • python爬数据做网站如何用vs做网站
  • 北京做网站建设的公司手机显示的网站该怎样设计
  • 做自媒体你不得不知道的视频网站电商平台如何推广运营
  • 有区域名和主机怎么做网站网站开发实用技术
  • 网站打不开被拦截怎么办东莞网站建设求职简历
  • 网站开发的软件百度资源平台链接提交
  • 安徽省建设厅网站个人怎么注册自己在家怎么做网站服务器
  • 枞阳做网站深圳社保网上服务平台
  • 唐山公司网站建设青岛网页设计培训机构
  • 网站的关于我们怎么做制作好的网页模板如何放入网站cms中
  • 做网站需要板块空间设计说明