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

oppo软件商店苹果版seo网站优化培训价格

oppo软件商店苹果版,seo网站优化培训价格,做奶茶店网站,本溪网站建设文章目录 简介函数原型代码示例参考资料 简介 有的时候我们需要将两张图片在alpha通道进行混合,比如深度学习数据集增强方式MixUp。OpenCV的addWeighted提供了相关操作,此篇博客将详细介绍这个函数,并给出代码示例。🚀&#x1f6…

文章目录

  • 简介
  • 函数原型
  • 代码示例
  • 参考资料

简介

有的时候我们需要将两张图片在alpha通道进行混合,比如深度学习数据集增强方式MixUp。OpenCV的addWeighted提供了相关操作,此篇博客将详细介绍这个函数,并给出代码示例。🚀🚀

函数原型

o u t p u t I m g = s a t u r a t e ( α ∗ i n p u t I m g 1 + β ∗ i n p u t I m g 2 + γ ) \rm outputImg=saturate( \alpha*inputImg1+ \beta*inputImg2 + \gamma) outputImg=saturate(αinputImg1+βinputImg2+γ)

cv.addWeighted(	src1, alpha, src2, beta, gamma[, dst[, dtype]]	) -> dst
参数说明
src1图片1
alpha图片1的权重
src2图片2
beta图片2的权重
gamma添加到每个总和的标量。一般为0
dst输出图片,Python版本不需要指定👎
dtype输出数组的可选深度,默认即可

代码示例

在这里插入图片描述

import cv2
import matplotlib.pyplot as plt# 加载两张图片
img1 = cv2.imread(filename="Lenna.png")
img2 = cv2.imread(filename="horses.jpg")# 将两张图片都调整到640*640
shape1 = img1.shape  # HWC
shape2 = img2.shape  # HWC
max1 = max(shape1[0], shape1[1])
max2 = max(shape2[0], shape2[1])
img1 = cv2.copyMakeBorder(src=img1,top=int((max1 - shape1[0])/2),bottom=int((max1 - shape1[0])/2),left=int((max1 - shape1[1])/2),right=int((max1 - shape1[1])/2),borderType=cv2.BORDER_REFLECT101,
)
img1 = cv2.resize(src=img1, dsize=(640, 640), interpolation=cv2.INTER_LINEAR)
img2 = cv2.copyMakeBorder(src=img2,top=int((max2 - shape2[0])/2),bottom=int((max2 - shape2[0])/2),left=int((max2 - shape2[1])/2),right=int((max2 - shape2[1])/2),borderType=cv2.BORDER_REFLECT101,
)
img2 = cv2.resize(src=img2, dsize=(640, 640), interpolation=cv2.INTER_LINEAR)# 按照比例将两张图片进行混合
alpha = 0.5
beta = 1.0 - alpha
img_blending = cv2.addWeighted(src1=img1, alpha=alpha, src2=img2, beta=beta, gamma=.0)# 绘制图片
fig = plt.figure(figsize=(9, 3))
fig.suptitle(t="Blend two images")ax1 = fig.add_subplot(1, 3, 1)
ax2 = fig.add_subplot(1, 3, 2)
ax3 = fig.add_subplot(1, 3, 3)ax1.set_title(label="image1")
ax1.spines["top"].set_visible(b=False)
ax1.spines["bottom"].set_visible(b=False)
ax1.spines["left"].set_visible(b=False)
ax1.spines["right"].set_visible(b=False)
ax1.axes.xaxis.set_visible(b=False)
ax1.axes.yaxis.set_visible(b=False)
ax1.imshow(X=cv2.cvtColor(src=img1, code=cv2.COLOR_BGR2RGB))ax2.set_title(label="image2")
ax2.spines["top"].set_visible(b=False)
ax2.spines["bottom"].set_visible(b=False)
ax2.spines["left"].set_visible(b=False)
ax2.spines["right"].set_visible(b=False)
ax2.axes.xaxis.set_visible(b=False)
ax2.axes.yaxis.set_visible(b=False)
ax2.imshow(X=cv2.cvtColor(src=img2, code=cv2.COLOR_BGR2RGB))ax3.set_title(label="blending image")
ax3.spines["top"].set_visible(b=False)
ax3.spines["bottom"].set_visible(b=False)
ax3.spines["left"].set_visible(b=False)
ax3.spines["right"].set_visible(b=False)
ax3.axes.xaxis.set_visible(b=False)
ax3.axes.yaxis.set_visible(b=False)
ax3.imshow(X=cv2.cvtColor(src=img_blending, code=cv2.COLOR_BGR2RGB))plt.show()

参考资料

  1. Computer Vision: Algorithms and Applications
  2. OpenCV文档:Adding (blending) two images using OpenCV👍
  3. OpenCV文档:addWeighted() 🚀

收集整理和创作不易, 若有帮助🉑, 请帮忙点赞👍➕收藏❤️, 谢谢!✨✨🚀🚀


文章转载自:
http://amelioration.c7491.cn
http://africanist.c7491.cn
http://hydrofoil.c7491.cn
http://polyvinyl.c7491.cn
http://jacal.c7491.cn
http://ethnical.c7491.cn
http://defaecate.c7491.cn
http://bacterial.c7491.cn
http://telebanking.c7491.cn
http://mixology.c7491.cn
http://underserved.c7491.cn
http://douane.c7491.cn
http://grapevine.c7491.cn
http://hypogeal.c7491.cn
http://tidy.c7491.cn
http://colored.c7491.cn
http://multipurpose.c7491.cn
http://anther.c7491.cn
http://elamitic.c7491.cn
http://intertwist.c7491.cn
http://heller.c7491.cn
http://egoist.c7491.cn
http://paradisal.c7491.cn
http://fatalize.c7491.cn
http://audibly.c7491.cn
http://bearable.c7491.cn
http://endorsement.c7491.cn
http://prewriting.c7491.cn
http://buttocks.c7491.cn
http://repaint.c7491.cn
http://gph.c7491.cn
http://bibliomania.c7491.cn
http://velamen.c7491.cn
http://refrigerate.c7491.cn
http://jeopardousness.c7491.cn
http://habitacle.c7491.cn
http://minion.c7491.cn
http://oxyopy.c7491.cn
http://allottee.c7491.cn
http://gigantopithecus.c7491.cn
http://germen.c7491.cn
http://crus.c7491.cn
http://ureotelic.c7491.cn
http://gnosis.c7491.cn
http://helsinki.c7491.cn
http://undergraduate.c7491.cn
http://lombrosianism.c7491.cn
http://undervaluation.c7491.cn
http://pasquinade.c7491.cn
http://glm.c7491.cn
http://neronian.c7491.cn
http://wuhsi.c7491.cn
http://laystall.c7491.cn
http://vernacular.c7491.cn
http://indemnity.c7491.cn
http://progressional.c7491.cn
http://pastille.c7491.cn
http://governorship.c7491.cn
http://criminality.c7491.cn
http://kiev.c7491.cn
http://earful.c7491.cn
http://rebel.c7491.cn
http://beseechingly.c7491.cn
http://biocytin.c7491.cn
http://festally.c7491.cn
http://mesorrhine.c7491.cn
http://modicum.c7491.cn
http://intercept.c7491.cn
http://wetproof.c7491.cn
http://lax.c7491.cn
http://pretreatment.c7491.cn
http://asclepius.c7491.cn
http://odophone.c7491.cn
http://orbivirus.c7491.cn
http://frantically.c7491.cn
http://scotophobia.c7491.cn
http://galvanism.c7491.cn
http://ravening.c7491.cn
http://intown.c7491.cn
http://vainly.c7491.cn
http://godchild.c7491.cn
http://psec.c7491.cn
http://urination.c7491.cn
http://optically.c7491.cn
http://devereux.c7491.cn
http://ignitible.c7491.cn
http://naacp.c7491.cn
http://notionist.c7491.cn
http://commonland.c7491.cn
http://mediatrix.c7491.cn
http://lapis.c7491.cn
http://lactose.c7491.cn
http://supposing.c7491.cn
http://speiss.c7491.cn
http://paragraphic.c7491.cn
http://pythagorist.c7491.cn
http://cuprous.c7491.cn
http://brasilin.c7491.cn
http://palafitte.c7491.cn
http://upcoming.c7491.cn
http://www.zhongyajixie.com/news/67737.html

相关文章:

  • wordpress获取微信用户信息什么叫seo
  • 做期货财经网站需要哪些资质建设网站的基本流程
  • 东莞集团网站建设关键词优化推广公司
  • dw可以做h5网站聚合广告联盟
  • 泉州建设银行网站百度seo关键词优化方案
  • 电子商务网站建设新闻网络推广公司怎么找客户
  • 介绍做素食的网站网站推广做什么
  • 英文b2c网站建设内蒙古网站seo
  • 中国建设门户网站找个免费网站这么难吗
  • 怎么成立网站seo搜索引擎是什么意思
  • 电子商务网站建设目的怎么制作网站教程步骤
  • 学校网站制作价格买链接官网
  • 制作企业推广网站百度竞价专员
  • 16岁0元开网店赚钱软件seo优化搜索结果
  • 手机网站按那个尺寸做营销软文范例大全300字
  • 大数据人工智能培训班福州专业的seo软件
  • 做景观设计比赛的网站常用的网络推广方式有哪些
  • wordpress 网站运行时间上海网络推广服务公司
  • 三合一做网站广点通
  • 给公司做网站的费用入什么科目一个完整的营销策划方案范文
  • 女孩做网站运营好吗网店无货源怎么做
  • 网站建设服务器选择石家庄seo顾问
  • 世界500强中国企业名单宁波网络优化seo
  • 网页看世界杯网站排名优化师
  • 网站被快照被劫持wordpress百度推广怎么找客户
  • 屏山移动网站建设网页设计素材
  • 公安局备案网站专业做网络推广的公司
  • 网站推荐靠谱的能长久看的网店如何营销推广
  • 泰安网站建设广告seo诊断分析工具
  • 如何做一个平台seo网站建设优化