当前位置: 首页> 房产> 市场 > 开发公司工程部管理流程_福建省人民政府网站官网_seo网站优化怎么做_怎么开通百度推广账号

开发公司工程部管理流程_福建省人民政府网站官网_seo网站优化怎么做_怎么开通百度推广账号

时间:2025/7/29 5:52:58来源:https://blog.csdn.net/weixin_45014634/article/details/144448788 浏览次数:0次
开发公司工程部管理流程_福建省人民政府网站官网_seo网站优化怎么做_怎么开通百度推广账号

滑块验证码,滑块和有缺口的背景

突破滑动验证码有缺口的背景内容
在这里插入图片描述

import cv2 as cv
import numpy as np
import osdef find_p(img):ret, thresh = cv.threshold(img, 127, 255, 0)img = cv.cvtColor(img, cv.COLOR_GRAY2BGR)contours, hierarchy = cv.findContours(thresh, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)# print(len(contours))cnt = contours[0]x, y, w, h = cv.boundingRect(cnt)img = cv.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2)# cv.imshow('7', img)return x, y, w, h, thresh[y: y + h, x: x + w]def tmp_match(img, tar):w, h = tar.shape[0:-1]# methods = ['cv.TM_CCOEFF', 'cv.TM_CCOEFF_NORMED', 'cv.TM_CCORR',#            'cv.TM_CCORR_NORMED', 'cv.TM_SQDIFF', 'cv.TM_SQDIFF_NORMED']method = cv.TM_CCOEFF_NORMED# Apply template Matchingres = cv.matchTemplate(img, tar, method)min_val, max_val, min_loc, max_loc = cv.minMaxLoc(res)# If the method is TM_SQDIFF or TM_SQDIFF_NORMED, take minimumtop_left = max_locbottom_right = (top_left[0] + w, top_left[1] + h)cv.rectangle(img, top_left, bottom_right, 255, 2)# cv.imshow('5', img)return top_leftdef sub_img_op(pth, pth1):img = cv.imread(pth, -1)img_tar = cv.imread(pth1)sub_img = img[:, :, 3]img_o = cv.cvtColor(img, cv.COLOR_BGRA2BGR)# sub_img = cv.cvtColor(sub_img, cv.GRAY2BGR)# print(sub_img[50:70, :])x, y, w, h, mask = find_p(sub_img)white_img = np.ones([h, w, 3], dtype='uint8') * 255# print(x, y, w, h)img_tar_sub = img_tar[y: y + h, :, :]img_o_sub = img_o[y: y + h, x: x + w, :]res_img = cv.addWeighted(img_o_sub, 0.7, white_img, 0.3, 0)# res_img = img_o_subtop_left = tmp_match(img_tar_sub, res_img)print(top_left[0])# cv.imshow('1', img_o)cv.imshow('2', img_tar_sub)cv.imshow('3', res_img)cv.waitKey()cv.destroyAllWindows()return top_left[0]
关键字:开发公司工程部管理流程_福建省人民政府网站官网_seo网站优化怎么做_怎么开通百度推广账号

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: