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

建电子商务网站被代运营骗了去哪投诉

建电子商务网站,被代运营骗了去哪投诉,大学个人网站期末作业,2345浏览器网址OpenCV 嘴部检测 嘴部区域检测 1. 静态图像检测嘴部区域创建分类器加载特征文件检测图像绘制嘴部区域显示 2. 切换为摄像头import cv2 import numpy as npclass FaceDetect:def __init__(self):# 级联分类器# 创建级联分类器#xf…OpenCV 嘴部检测 嘴部区域检测 1. 静态图像检测嘴部区域创建分类器加载特征文件检测图像绘制嘴部区域显示 2. 切换为摄像头import cv2 import numpy as npclass FaceDetect:def __init__(self):# 级联分类器# 创建级联分类器当前用于检测人脸classifier_face cv2.CascadeClassifier()classifier_mouth cv2.CascadeClassifier()# 加载 特征文件classifier_face.load(./haarcascade_frontalface_alt.xml)classifier_mouth.load(./haarcascade_mcs_mouth.xml)self.classifier_face classifier_faceself.classifier_mouth classifier_mouth# 初始化logoself.logo cv2.imread(./fans.jpg)passdef capVideo(self):cap cv2.VideoCapture(0)while cap.isOpened():# 读取一帧一帧的图像retval, frame cap.read()if not retval:print(can not read frame)break# imshow 会默认创建一个窗口self.detect(frame)cv2.imshow(frame, frame)key cv2.waitKey(25)if key ord(z):breakcap.release()passdef detect(self, face_img):# 级联分类器检测人脸face_rects self.classifier_face.detectMultiScale(face_img)# 绘制人脸区域for face_rect in face_rects:x, y, w, h face_rectcv2.rectangle(face_img, (x, y), (x w, y h), color(0, 0, 255), thickness2)# self.drawLogo(face_rect, face_img)# self.drawLogo2(face_rect, face_img)self.detectMouth(face_rect, face_img)def detectMouth(self, face_rect, face_img):# 检测嘴巴mouth_rects self.classifier_mouth.detectMultiScale(face_img)face_min_x, face_min_y, face_w, face_h face_rect# 方式1# for mouth_rect in mouth_rects:# x, y, w, h mouth_rect# # 排除人脸左右区域# # if x face_min_x or x face_min_x face_w:# # continue# # # 排除人脸上下区域# # if y face_min_y or y face_min_y face_h:# # continue# # 排除人脸中部上面的区域# if y face_min_y face_h * 0.6:# continue# cv2.rectangle(face_img, (x, y), (x w, y h), color(0, 255, 0), thickness2)# 方式2# is_right_mouth mouth_rects[:, 0] face_min_x# is_down_mouth mouth_rects[:, 1] face_min_y# is_lower_mouth mouth_rects[:, 1] (face_min_y face_h * 0.6)# is_mouth is_right_mouth is_down_mouth is_lower_mouth# mouth_rect mouth_rects[is_mouth]idx mouth_rects[:, 1] (face_min_y face_h * 0.6)mouth_rect mouth_rects[idx]for rect in mouth_rect:x, y, w, h rectcv2.rectangle(face_img, (x, y), (x w, y h), color(0, 255, 0), thickness2)def drawLogo(self, face_rect, face_img):x, y, w, h face_rectlogo self.logoratio min(logo.shape[:2]) / max(logo.shape[:2])scale_logo cv2.resize(logo, dsize(w, round(w * ratio)))scale_logo_h, scale_logo_w, _ scale_logo.shape# 方式1循环# for row in range(scale_logo_h):# for col in range(scale_logo_w):# face_img[y - scale_logo_h row, x col] scale_logo[row, col]# pass# 方式2切片face_img[y - scale_logo_h:y, x:x scale_logo_w] scale_logodef drawLogo2(self, face_rect, face_img):1. 找轮廓- 原图三通道彩色图- 灰度图0-255- 黑白二值图0/2552. 绘制轮廓- 绘制在背景是白色的图:param face_rect::param face_img::return:# 参数1 被转换的图像# 参数2 原图转为灰度图logo_gray cv2.cvtColor(self.logo, cv2.COLOR_BGR2GRAY)# 转为二值图# 参数1 灰度图# 参数2 阈值 小于阈值为0# 参数3 大于阈值为maxval# 参数4 类型 cv2.THRESH_BINARY cv2.THRESH_OTSU 会自适应阈值# retval, logo_binary cv2.threshold(logo_gray, 100, 255, cv2.THRESH_BINARY)retval, logo_binary cv2.threshold(logo_gray, 100, 255, cv2.THRESH_OTSU)# 查找轮廓# 参数1 被查找的二值图# 参数2 轮廓存放的层级关系# 参数3 存放轮廓的方式 cv2.CHAIN_APPROX_SIMPLE 存放轮廓的拐角点contours, hierarchy cv2.findContours(logo_binary, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)# 创建一个黑色的背景图mask np.zeros_like(self.logo)cv2.drawContours(mask, contours, 1, color(255, 255, 255), thickness-1)x, y, w, h face_rectlogo self.logoratio min(logo.shape[:2]) / max(logo.shape[:2])scale_logo cv2.resize(logo, dsize(w, round(w * ratio)))scale_mask cv2.resize(mask, dsize(w, round(w * ratio)))scale_logo_h, scale_logo_w, _ scale_logo.shape# 方式1循环# for row in range(scale_logo_h):# for col in range(scale_logo_w):# if np.all(scale_mask[row, col] 255):# face_img[y - scale_logo_h row, x col] scale_logo[row, col]# 方式2切片idx scale_mask 255after_mask_logo scale_logo[idx]face_img[y - scale_logo_h:y, x:x scale_logo_w][idx] after_mask_logopassif __name__ __main__:face_img cv2.imread(./lyf.png)face_detect FaceDetect()# face_detect.capVideo()face_detect.detect(face_img)cv2.imshow(frame, face_img)cv2.waitKey(0)cv2.destroyAllWindows()人脸原图 嘴部检测效果图
http://www.zqtcl.cn/news/227834/

相关文章:

  • 跟老外做网站网络系统管理与维护机考
  • 网站推广方案范例江西南昌小程序开发
  • 烘焙类网站开发时代背景ppt素材模板免费下载
  • 如何制作多网页网站广州品牌seo推广
  • 域名怎么解析到网站什么是asp网站
  • 网站开发的税率做网站文案
  • 网站模板上传工具如何介绍自己设计的网页
  • 河北网站建设价格低国内做外单的网站有哪些
  • wordpress Apache升级优化营商环境的意义
  • 单页式网站系统wordpress自定义字段怎么用
  • 南宁网站设计要多少钱修改wordpress中的 功能 小工具
  • 南昌高端网站开发费用表域名价格排行
  • 怎么接网站开发外包中国观鸟记录的网站架构
  • 青海省住房和城乡建设厅的官方网站网站举报能不能查到举报人
  • dw做的网站如何上传云服务器网址生成app一键生成器
  • 山西建设厅网站密钥房山营销型网站建设
  • 网站空间多少钱哪里接单做网站
  • 建设部网站资质人员查询页面设计的对称方法包括哪几种形式
  • 滁州网站建设哪个好点iis发布网站无法访问
  • 网站项目建设的定义百度站长平台清退
  • ip开源网站FPGA可以做点什么建设网站的工作职责
  • 重庆微信网站开发公司建设网站技术标准
  • 网站开发浏览器银川市建设诚信平台网站
  • 找合伙人做红木家具网站建设银行员工学习网站
  • iis的默认网站没有自动启动长春小程序开发制作
  • 佛山住房和城乡建设部网站wordpress 英文主题
  • 零食网站策划书厦门建设网站的公司
  • 自己做的网站怎么发布到网上湖南做网站 干净磐石网络
  • steam网站代做设计公司招聘信息
  • 网站开发 书籍无广告自助建站