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

南阳开网站制作教务系统网站怎么做

南阳开网站制作,教务系统网站怎么做,wordpress音频播放不了,dw里面怎么做网站轮播图用户常常将多张图拼成一张图。 如果将这张图拆为多个子图#xff0c;下面是一种opencv的办法#xff0c;后面要训练一个模型来识别边缘更为准确。 import osimport cv2 import numpy as npdef detect_lines(image_path):# 读取图片image cv2.imread(image_path)if image i…用户常常将多张图拼成一张图。 如果将这张图拆为多个子图下面是一种opencv的办法后面要训练一个模型来识别边缘更为准确。 import osimport cv2 import numpy as npdef detect_lines(image_path):# 读取图片image cv2.imread(image_path)if image is None:raise ValueError(无法读取图片请检查路径是否正确)# 将图片转为灰度图gray cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)# 使用Canny边缘检测edges cv2.Canny(gray, 20, 240, apertureSize3)# 使用霍夫变换检测线段lines cv2.HoughLinesP(edges, 1, np.pi / 180, threshold100, minLineLength300, maxLineGap10)chuizhi []shuiping []# 筛选出水平和垂直的线段并绘制if lines is not None:for line in lines:for x1, y1, x2, y2 in line:if abs(y1 - y2) 5: # 水平线段shuiping.append((x1, y1, x2, y2))elif abs(x1 - x2) 5:chuizhi.append((x1, y1, x2, y2))if len(shuiping) 0 and len(chuizhi) 0:return [image]# 拆图ys []for x1, y1, x2, y2 in shuiping:ys.append(y1)ys.append(y2)ys.sort()ys [0] ys [image.shape[0]]y_images []for i in range(len(ys) - 1):if ys[i 1] - ys[i] 100:continuey_images.append(image[ys[i]:ys[i 1], :])xs []for x1, y1, x2, y2 in chuizhi:xs.append(x1)xs.append(x2)xs.sort()xs [0] xs [image.shape[1]]x_images []for i in range(len(xs) - 1):if xs[i 1] - xs[i] 100:continuefor y_image in y_images:x_images.append(y_image[:, xs[i]:xs[i 1]])# 去除宽高比超过5的x_images [x_image for x_image in x_images ifx_image.shape[0] / x_image.shape[1] 5 or x_image.shape[1] / x_image.shape[0] 5]return x_imagesdef listPathAllfiles(dirname):result []for maindir, subdir, file_name_list in os.walk(dirname):for filename in file_name_list:apath os.path.join(maindir, filename)result.append(apath)return resultsrc rC:\Users\Administrator\Pictures\girl_no_train\mangguo dst rC:\Users\Administrator\Pictures\girl_no_train\mangguo_dst if not os.path.exists(dst):os.makedirs(dst) files listPathAllfiles(src) for file in files:x_images detect_lines(file)for i, x_image in enumerate(x_images):cv2.imwrite(f{dst}/{os.path.basename(file)}_{i}.jpg, x_image)
http://www.w-s-a.com/news/8151/

相关文章:

  • 个人网站建设需求说明书微信域名防封在线生成
  • 专业网站建设的公司wordpress后台没有模板
  • 哈尔滨网站运营服务商制作外贸网站公司
  • 个人网站需要备案宁波网站推广工具
  • 苏州建设银行网站首页wordpress修改密码
  • 网站建设员工技能要求网站制作简单协议
  • 没有ipc备案的网站wordpress isux主题
  • 清远做网站电子商务网站建设需要的语言及特点6
  • 万州那家做网站c语言基础知识入门
  • 齐河网站建设公司价格网站建设包括什么
  • 论坛网站开发费用怎么把文件放到网站的根目录
  • 海南省零售户电商网站官渡区住房和城乡建设局网站
  • 怎么找淘宝客网站最新军事战况
  • 缺乏门户网站建设网页设计与制作项目教程第二版
  • 手机网站横竖屏一般做建设的是什么公司
  • 免费网站建设无广告网站开发 华景新城
  • 湖州网站制作报价西安网站开发有哪些公司
  • google 浏览器开源seo软件
  • 网站空间是什么意思自己怎样建设网站
  • 国外家装设计网站如何做软件开发
  • 凡科建站登录官网当当网网站建设策划书
  • 网站百度屏蔽关键词杭州排名优化公司
  • h5响应式网站模板下载wordpress鼠标指针
  • 摄影作品投稿网站目前最好的引流推广方法
  • 资源站源码永久dede网站搬家 空间转移的方法
  • 网站建设销售的技巧话语it培训机构
  • 自建本地网站服务器wordpress南充房产网最新楼盘最近房价
  • 郑州代做网站天津哪里能做网站
  • 网站如何做排名网站建设项目的工作分解
  • 洛阳网络建站公司网站开发主流语言