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

做网站的排名seo关键词快速排名

做网站的排名,seo关键词快速排名,临汾网站建设费用,网站建设从零开始 教程用户常常将多张图拼成一张图。 如果将这张图拆为多个子图,下面是一种opencv的办法,后面要训练一个模型来识别边缘更为准确。 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, apertureSize=3)# 使用霍夫变换检测线段lines = cv2.HoughLinesP(edges, 1, np.pi / 180, threshold=100, minLineLength=300, maxLineGap=10)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 = r"C:\Users\Administrator\Pictures\girl_no_train\mangguo"
dst = r"C:\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.mmbaike.com/news/32735.html

相关文章:

  • 做目的旅游网站的搜索引擎排名竞价
  • 自动化营销网站建设成都官网seo服务
  • 网站怎样续费全球搜怎么样
  • 大连开发区招聘网站怎样推广公司的网站
  • 门户网站建设方案目录域名查询ip网站
  • 网站搜索优化怎么做百度小说风云榜排名
  • 福建城市建设厅网站抖音指数
  • 多商城入住网站建设seo培训班
  • 中小公司做网站西地那非片吃了多久会硬起来
  • vscode的网站开发配置网页制作与设计教程
  • 商标设计网站猪八戒关键词列表
  • 网站建设专业公司磁力岛
  • 武汉p2p网站制作公司自己动手建立个人网站
  • 长沙网站设计培训线上免费推广平台都有哪些
  • 开原网站制作近期国际新闻20条
  • 牛b插网站建设学做网站需要学什么
  • 专业微网站营销搜索引擎优化指的是什么
  • 自己做的网站能被百度收录吗搜索引擎网址有哪些
  • 智慧团建官方网站登录入口福州seo按天付费
  • 用什么软件做楼盘微网站东莞关键词排名快速优化
  • php餐饮网站神点击恶意点击软件
  • 专门做饥饿营销的网站产品推销
  • 北京教育学会网站建设网站推广的内容
  • 虎门做网站公司关键词研究工具
  • 艾辰做网站推广方案设计
  • 营销知识和技巧东莞整站优化排名
  • 深圳集团网站开发公司seo
  • h5与wordpress百度搜索排行seo
  • 做游戏直播那个网站好百度小程序排名优化
  • 2022年编程语言官方排行榜恩城seo的网站