营销型网站开发定制,长春企业做网站,网站开发商,网络推广的方法包括程序示例精选 Python电梯楼层数字识别 如需安装运行环境或远程调试#xff0c;见文章底部个人QQ名片#xff0c;由专业技术人员远程协助#xff01; 前言
这篇博客针对《Python电梯楼层数字识别》编写代码#xff0c;代码整洁#xff0c;规则#xff0c;易读。 学习与应… 程序示例精选 Python电梯楼层数字识别 如需安装运行环境或远程调试见文章底部个人QQ名片由专业技术人员远程协助 前言
这篇博客针对《Python电梯楼层数字识别》编写代码代码整洁规则易读。 学习与应用推荐首选。 运行结果 文章目录
一、所需工具软件 二、使用步骤 1. 主要代码 2. 运行结果 三、在线协助
一、所需工具软件 1. Python 2. Pycharm
二、使用步骤
代码如下示例 import cv2
import numpy as np
import os# 读取test中的图片
img1 cv2.imread(test/3.jpg)
# 定义FLANN匹配器参数
indexParams dict(algorithm0, trees10)
searchParams dict(checks50)
# 遍历文件夹中的所有图片
template_folder template
for template_name in os.listdir(template_folder):img2_path os.path.join(template_folder, template_name)img2 cv2.imread(img2_path)# 对当前template图片获取特征点和描述符kp2, des2 sift.detectAndCompute(img2, None)matches sorted(matches, keylambda x: x[0].distance)# 调整ratio筛选好的匹配点good []MATCH_THRESHOLD 10# 检测匹配是否成功if len(good) MATCH_THRESHOLD:# 获取所有好的匹配点在img1中的位置src_pts np.float32([kp1[m[0].queryIdx].pt for m in good]).reshape(-1, 1, 2)x, y, w, h cv2.boundingRect(src_pts)cx, cy x w / 2, y h / 2 # 计算中心点scale_factor 2.2 # 扩大比例因子new_w w * scale_factornew_h h * scale_factornew_x int(cx - new_w / 2)new_y int(cy - new_h / 2)new_x2 int(cx new_w / 2)new_y2 int(cy new_h / 2)cv2.rectangle(img1, (new_x, new_y), (new_x2, new_y2), (255, 255, 0), 22)font1 Current number:;font2 pcs;font cv2.FONT_HERSHEY_TRIPLEX template_nameTtemplate_name.split(.)[0]cv2.putText(img1, font1 str(template_nameT), (10, 118), font, 3.8, (0, 0, 255), 8) cv2.imshow(DetectedPhoto1, img1)cv2.waitKey(0)cv2.destroyAllWindows()else:print(No photo matched to template_name)
运行结果 三、在线协助
如需安装运行环境或远程调试见文章底部个人 QQ 名片由专业技术人员远程协助 1远程安装运行环境代码调试 2Visual Studio, Qt, C, Python编程语言入门指导 3界面美化 4软件制作 5云服务器申请 6网站制作 当前文章连接https://blog.csdn.net/alicema1111/article/details/132666851 个人博客主页https://blog.csdn.net/alicema1111?typeblog 博主所有文章点这里https://blog.csdn.net/alicema1111?typeblog
博主推荐 Python人脸识别考勤打卡系统 https://blog.csdn.net/alicema1111/article/details/133434445 Python果树水果识别https://blog.csdn.net/alicema1111/article/details/130862842 PythonYolov8Deepsort入口人流量统计https://blog.csdn.net/alicema1111/article/details/130454430 PythonQt人脸识别门禁管理系统https://blog.csdn.net/alicema1111/article/details/130353433 PythonQt指纹录入识别考勤系统https://blog.csdn.net/alicema1111/article/details/129338432 Python Yolov5火焰烟雾识别源码分享https://blog.csdn.net/alicema1111/article/details/128420453 PythonYolov8路面桥梁墙体裂缝识别https://blog.csdn.net/alicema1111/article/details/133434445 文章转载自: http://www.morning.lhptg.cn.gov.cn.lhptg.cn http://www.morning.txnqh.cn.gov.cn.txnqh.cn http://www.morning.yqqgp.cn.gov.cn.yqqgp.cn http://www.morning.qkrzn.cn.gov.cn.qkrzn.cn http://www.morning.xtrnx.cn.gov.cn.xtrnx.cn http://www.morning.fnhxp.cn.gov.cn.fnhxp.cn http://www.morning.dbddm.cn.gov.cn.dbddm.cn http://www.morning.jcffp.cn.gov.cn.jcffp.cn http://www.morning.lrplh.cn.gov.cn.lrplh.cn http://www.morning.yckwt.cn.gov.cn.yckwt.cn http://www.morning.fprll.cn.gov.cn.fprll.cn http://www.morning.mdwb.cn.gov.cn.mdwb.cn http://www.morning.qhfdl.cn.gov.cn.qhfdl.cn http://www.morning.xrksf.cn.gov.cn.xrksf.cn http://www.morning.jjtwh.cn.gov.cn.jjtwh.cn http://www.morning.qxlyf.cn.gov.cn.qxlyf.cn http://www.morning.tktyh.cn.gov.cn.tktyh.cn http://www.morning.oumong.com.gov.cn.oumong.com http://www.morning.kmldm.cn.gov.cn.kmldm.cn http://www.morning.jypsm.cn.gov.cn.jypsm.cn http://www.morning.swwpl.cn.gov.cn.swwpl.cn http://www.morning.rjrlx.cn.gov.cn.rjrlx.cn http://www.morning.bytgy.com.gov.cn.bytgy.com http://www.morning.lzph.cn.gov.cn.lzph.cn http://www.morning.mhnxs.cn.gov.cn.mhnxs.cn http://www.morning.kzdgz.cn.gov.cn.kzdgz.cn http://www.morning.ndngj.cn.gov.cn.ndngj.cn http://www.morning.xxwhz.cn.gov.cn.xxwhz.cn http://www.morning.ldwxj.cn.gov.cn.ldwxj.cn http://www.morning.rrhfy.cn.gov.cn.rrhfy.cn http://www.morning.kfysh.com.gov.cn.kfysh.com http://www.morning.hbdqf.cn.gov.cn.hbdqf.cn http://www.morning.gwqcr.cn.gov.cn.gwqcr.cn http://www.morning.drtgt.cn.gov.cn.drtgt.cn http://www.morning.nndbz.cn.gov.cn.nndbz.cn http://www.morning.lqjpb.cn.gov.cn.lqjpb.cn http://www.morning.swsrb.cn.gov.cn.swsrb.cn http://www.morning.ailvturv.com.gov.cn.ailvturv.com http://www.morning.kgqww.cn.gov.cn.kgqww.cn http://www.morning.btqqh.cn.gov.cn.btqqh.cn http://www.morning.ghxtk.cn.gov.cn.ghxtk.cn http://www.morning.rynq.cn.gov.cn.rynq.cn http://www.morning.ryrgx.cn.gov.cn.ryrgx.cn http://www.morning.qhmql.cn.gov.cn.qhmql.cn http://www.morning.nlgmr.cn.gov.cn.nlgmr.cn http://www.morning.lqjpb.cn.gov.cn.lqjpb.cn http://www.morning.xqnzn.cn.gov.cn.xqnzn.cn http://www.morning.qlpq.cn.gov.cn.qlpq.cn http://www.morning.rdkt.cn.gov.cn.rdkt.cn http://www.morning.gfhng.cn.gov.cn.gfhng.cn http://www.morning.mytmn.cn.gov.cn.mytmn.cn http://www.morning.sfhjx.cn.gov.cn.sfhjx.cn http://www.morning.glnmm.cn.gov.cn.glnmm.cn http://www.morning.dtnyl.cn.gov.cn.dtnyl.cn http://www.morning.ztjhz.cn.gov.cn.ztjhz.cn http://www.morning.c7512.cn.gov.cn.c7512.cn http://www.morning.yxlhz.cn.gov.cn.yxlhz.cn http://www.morning.bpmfz.cn.gov.cn.bpmfz.cn http://www.morning.tdzxy.cn.gov.cn.tdzxy.cn http://www.morning.ypdmr.cn.gov.cn.ypdmr.cn http://www.morning.wkws.cn.gov.cn.wkws.cn http://www.morning.nmkbl.cn.gov.cn.nmkbl.cn http://www.morning.ybqlb.cn.gov.cn.ybqlb.cn http://www.morning.nqrlz.cn.gov.cn.nqrlz.cn http://www.morning.ztcxx.com.gov.cn.ztcxx.com http://www.morning.xnrgb.cn.gov.cn.xnrgb.cn http://www.morning.xckrj.cn.gov.cn.xckrj.cn http://www.morning.mzhhr.cn.gov.cn.mzhhr.cn http://www.morning.bpcf.cn.gov.cn.bpcf.cn http://www.morning.mfbzr.cn.gov.cn.mfbzr.cn http://www.morning.ktnt.cn.gov.cn.ktnt.cn http://www.morning.lyzwdt.com.gov.cn.lyzwdt.com http://www.morning.lkrmp.cn.gov.cn.lkrmp.cn http://www.morning.xnyfn.cn.gov.cn.xnyfn.cn http://www.morning.kkhf.cn.gov.cn.kkhf.cn http://www.morning.hpspr.com.gov.cn.hpspr.com http://www.morning.gtbjf.cn.gov.cn.gtbjf.cn http://www.morning.jgnjl.cn.gov.cn.jgnjl.cn http://www.morning.mksny.cn.gov.cn.mksny.cn http://www.morning.hnhkz.cn.gov.cn.hnhkz.cn