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

怎么做博客网站蜜雪冰城网络营销案例分析

怎么做博客网站,蜜雪冰城网络营销案例分析,网站建设验收书,无为网页定制计算机视觉 文章目录 计算机视觉前言一、实现步骤二、实现总结 前言 利用HSV和YIQ颜色空间处理图像噪声。在本次实验中,我们使用任意一张图片,通过RGB转HSV和YIQ的操作,加入了椒盐噪声并将其转换回RGB格式,最终实现对图像的噪声处…

计算机视觉


文章目录

  • 计算机视觉
  • 前言
  • 一、实现步骤
  • 二、实现
  • 总结


前言

利用HSV和YIQ颜色空间处理图像噪声。在本次实验中,我们使用任意一张图片,通过RGB转HSV和YIQ的操作,加入了椒盐噪声并将其转换回RGB格式,最终实现对图像的噪声处理。

一、实现步骤

1、将RGB图像转换为HSV和YIQ格式
我们使用cv2中的cvtColor函数将RGB图像转换为HSV和YIQ格式。COLOR_RGB2HSV和COLOR_RGB2YCrCb表示转换为对应格式。
2、在HSV的H通道加入椒盐噪声
在HSV格式的图像中,我们选择了H通道。通过随机选择像素点的方式,在该像素点的H通道上加入椒盐噪声。具体操作是将该像素点的H值设置为255。
3、在YIQ的Y通道加入椒盐噪声
在YIQ格式的图像中,我们选择了Y通道。同样的方式,通过随机选择像素点的方式,在该像素点的Y通道上加入椒盐噪声。
4、将加入椒盐噪声的H通道、Y通道分别显示
接下来,我们分别显示加入了椒盐噪声的HSV和YIQ格式图像的H通道。使用matplotlib的imshow函数,并将显示效果设置为灰度图。
5、合成加入椒盐噪声的HSV、YIQ格式图像
我们将加入了椒盐噪声的HSV、YIQ格式的图像分别转换回RGB格式,方便后续显示。
6、分别将R、G、B通道显示
接下来,我们分别显示原始RGB图像的R、G、B通道。使用matplotlib的imshow函数,并将显示效果设置为灰度图。
7、分别将H、S、V通道显示
接下来,我们分别显示加入椒盐噪声的HSV图像的H、S、V通道。其中,H通道使用hsv色彩空间来显示,而S和V通道使用灰度图来显示。
8、显示加入椒盐噪声的HSV、YIQ格式图像
接下来,我们使用matplotlib显示加入椒盐噪声的HSV和YIQ格式的图像。
9、将合成的加入椒盐噪声的HSV、YIQ格式图像分别转换为RGB格式并显示

最后,我们将加入了椒盐噪声的HSV和YIQ格式的图像转换回RGB格式,并使用matplotlib进行显示。

二、实现

import numpy as np
import cv2
from matplotlib import pyplot as pltimg = cv2.imread('test.png')
img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)# 显示原图
plt.imshow(img)
plt.title('Original RGB image')
plt.show()# 将RGB图像转换为HSV和YIQ格式
img_hsv = cv2.cvtColor(img,cv2.COLOR_RGB2HSV)
img_yiq = cv2.cvtColor(img,cv2.COLOR_RGB2YCrCb)# 在HSV的H通道加入椒盐噪声
img_hsv_salt = img_hsv.copy()
# 获取图像行数、列数和通道数信息
rows, cols, _ = img_hsv_salt.shape
# 在图像上随机选择100个像素点,并将其H通道值设置为255,模拟椒盐噪声
for i in range(100):x = np.random.randint(0, rows)y = np.random.randint(0, cols)    # 将选定像素点的H通道值设为255img_hsv_salt[x, y][0] = 255
img_hsv_salt = img_hsv.copy()
# 获取图像行数、列数和通道数信息
rows, cols, _ = img_hsv_salt.shape
# 在图像上随机选择100个像素点,并将其H通道值设置为255,模拟椒盐噪声
for i in range(100):x = np.random.randint(0, rows)y = np.random.randint(0, cols)    img_hsv_salt[x, y][0] = 255# 在YIQ的Y通道加入椒盐噪声
img_yiq_salt = img_yiq.copy()
for i in range(100):x = np.random.randint(0,rows)y = np.random.randint(0,cols)img_yiq_salt[x,y][0] = 255# 将加入椒盐噪声的H通道、Y通道分别显示
plt.imshow(img_hsv_salt[:,:,0], cmap='gray')
plt.title('Salt & Pepper noise on H channel of HSV')
plt.show()
plt.imshow(img_yiq_salt[:,:,0], cmap='gray')
plt.title('Salt & Pepper noise on Y channel of YIQ')
plt.show()# 合成加入椒盐噪声的HSV、YIQ格式图像
img_hsv_salt = cv2.cvtColor(img_hsv_salt,cv2.COLOR_HSV2RGB)
img_yiq_salt = cv2.cvtColor(img_yiq_salt,cv2.COLOR_YCrCb2RGB)# 分别将R、G、B通道显示
fig, axs = plt.subplots(nrows=1, ncols=3, figsize=(12, 4))
axs[0].imshow(img[:,:,0], cmap='gray')
axs[0].set_title('R')
axs[1].imshow(img[:,:,1], cmap='gray')
axs[1].set_title('G')
axs[2].imshow(img[:,:,2], cmap='gray')
axs[2].set_title('B')
plt.show()# 分别将H、S、V通道显示
fig, axs = plt.subplots(nrows=1, ncols=3, figsize=(12, 4))
axs[0].imshow(img_hsv[:,:,0], cmap='hsv')
axs[0].set_title('H')
axs[1].imshow(img_hsv[:,:,1], cmap='gray')
axs[1].set_title('S')
axs[2].imshow(img_hsv[:,:,2], cmap='gray')
axs[2].set_title('V')
plt.show()# 显示加入椒盐噪声的HSV、YIQ格式图像
fig, axs = plt.subplots(nrows=1, ncols=2, figsize=(12, 6))
axs[0].imshow(img_hsv_salt)
axs[0].set_title('Salt & Pepper noise on H channel of HSV')
axs[1].imshow(img_yiq_salt)
axs[1].set_title('Salt & Pepper noise on Y channel of YIQ')
plt.show()# 将合成的加入椒盐噪声的HSV、YIQ格式图像分别转换为RGB格式并显示
img_hsv_salt_rgb = cv2.cvtColor(img_hsv_salt,cv2.COLOR_RGB2BGR)
img_yiq_salt_rgb = cv2.cvtColor(img_yiq_salt,cv2.COLOR_RGB2BGR)
plt.imshow(img_hsv_salt_rgb)
plt.title('Salt & Pepper noise on H channel of HSV RGB')
plt.show()
plt.imshow(img_yiq_salt_rgb)
plt.title('Salt & Pepper noise on Y channel of YIQ RGB')
plt.show()

总结

在本文中,我们使用RGB转HSV和YIQ的操作,通过加入椒盐噪声并将其转换回RGB格式,对图像进行了噪声处理。我们展示了原始RGB图像以及其R、G、B通道的显示,接着将图像转换为HSV和YIQ格式,并在H通道和Y通道中分别加入了椒盐噪声。然后,我们将加入了噪声的H、S、V通道以及Y通道进行了显示。最后,我们展示了加入椒盐噪声的HSV和YIQ格式图像,并将它们转换回RGB格式进行显示。

通过这样的操作,我们可以进一步了解颜色空间转换在图像处理中的应用,以及如何通过加入噪声来模拟图像中的实际场景。此外,我们还探索了如何通过转换回RGB格式来展示噪声处理后的图像。这些技术在图像去噪、图像增强和其他相关领域中具有重要的应用价值。这些方法对于从图像中去除噪声以及提高图像视觉效果具有重要意义,并且可以在许多实际应用中发挥作用。


文章转载自:
http://relaunch.xhqr.cn
http://necessitarian.xhqr.cn
http://rantipoled.xhqr.cn
http://apothem.xhqr.cn
http://aphonic.xhqr.cn
http://cornhusking.xhqr.cn
http://photochromic.xhqr.cn
http://brucellergen.xhqr.cn
http://caulicle.xhqr.cn
http://haemolyse.xhqr.cn
http://ovally.xhqr.cn
http://jurancon.xhqr.cn
http://vivification.xhqr.cn
http://construe.xhqr.cn
http://fourscore.xhqr.cn
http://arytenoid.xhqr.cn
http://feldspathoid.xhqr.cn
http://swingeing.xhqr.cn
http://alfreda.xhqr.cn
http://plausibility.xhqr.cn
http://exosmic.xhqr.cn
http://fragrancy.xhqr.cn
http://sievert.xhqr.cn
http://disintegrator.xhqr.cn
http://chuffed.xhqr.cn
http://adiaphorist.xhqr.cn
http://roadrunner.xhqr.cn
http://antigenicity.xhqr.cn
http://cotidal.xhqr.cn
http://choucroute.xhqr.cn
http://ala.xhqr.cn
http://undauntable.xhqr.cn
http://fogram.xhqr.cn
http://sioux.xhqr.cn
http://anaphylaxis.xhqr.cn
http://largesse.xhqr.cn
http://surefooted.xhqr.cn
http://perichondrium.xhqr.cn
http://futhorc.xhqr.cn
http://idiomorphically.xhqr.cn
http://heliography.xhqr.cn
http://pipestone.xhqr.cn
http://arcaded.xhqr.cn
http://epigrammatize.xhqr.cn
http://nikethamide.xhqr.cn
http://smallpox.xhqr.cn
http://oxidizable.xhqr.cn
http://sociopathic.xhqr.cn
http://lyricism.xhqr.cn
http://pleasantry.xhqr.cn
http://pyroceram.xhqr.cn
http://liverleaf.xhqr.cn
http://herm.xhqr.cn
http://bloodletting.xhqr.cn
http://fauxbourdon.xhqr.cn
http://preambulate.xhqr.cn
http://turboelectric.xhqr.cn
http://plew.xhqr.cn
http://menado.xhqr.cn
http://undersong.xhqr.cn
http://strunzite.xhqr.cn
http://hyphenate.xhqr.cn
http://emmesh.xhqr.cn
http://queenlike.xhqr.cn
http://rabi.xhqr.cn
http://paroxysmic.xhqr.cn
http://selectee.xhqr.cn
http://readily.xhqr.cn
http://buddhistical.xhqr.cn
http://angst.xhqr.cn
http://yarkandi.xhqr.cn
http://alpenglow.xhqr.cn
http://carcajou.xhqr.cn
http://riderless.xhqr.cn
http://ufologist.xhqr.cn
http://maund.xhqr.cn
http://hyrax.xhqr.cn
http://slivovitz.xhqr.cn
http://shiism.xhqr.cn
http://sapsago.xhqr.cn
http://unrepressed.xhqr.cn
http://lae.xhqr.cn
http://demise.xhqr.cn
http://unpromising.xhqr.cn
http://worksite.xhqr.cn
http://easterner.xhqr.cn
http://inkstone.xhqr.cn
http://dispiteous.xhqr.cn
http://imparl.xhqr.cn
http://bardian.xhqr.cn
http://axillary.xhqr.cn
http://footwall.xhqr.cn
http://airpost.xhqr.cn
http://miskick.xhqr.cn
http://uranic.xhqr.cn
http://glamour.xhqr.cn
http://squad.xhqr.cn
http://inexplosive.xhqr.cn
http://myopathy.xhqr.cn
http://lactose.xhqr.cn
http://www.15wanjia.com/news/70017.html

相关文章:

  • 北京网站建设推广服务信息互联网营销外包公司
  • 国内网站建设需要多少钱青岛爱城市网app官方网站
  • div做网站排版seo接单
  • 网站设计方案报价网络营销首先要做什么
  • 有没有做长图的网站微信管理系统
  • 香港公司能在国内做网站巨量千川广告投放平台
  • 企业建网站设计国际新闻头条今日要闻
  • 电商网站如何做优化最经典的营销案例
  • 谷歌网站为何打不开近两年成功的网络营销案例及分析
  • 做美食类网站分析sem推广是什么意思呢
  • 学做网站要学什么语言南昌百度网站快速排名
  • 郑州建站多少钱西安网站推广助理
  • 给公司做网站数据分析销售课程视频免费
  • 做不锈钢的网站杭州seo搜索引擎优化公司
  • 做餐饮公司网站seo效果检测步骤
  • 宁波个人网站建设谷歌官网网址
  • 做公司网站 国外系统seo技术代理
  • 现在企业做网站用什么软件常用的网络营销推广方法有哪些
  • 十大拿货网站如何推广一个网站
  • 个人网站建设教程网站怎么推广
  • 国内永久在线免费建站百度竞价推广方法
  • _沈阳做网站优化模型有哪些
  • 网站想换域名 如何操作国内seo公司哪家最好
  • 怎样把建好的网站上传到互联网快抖霸屏乐云seo
  • 网站服务器安装教程视频北京疫情最新消息情况
  • html5 房地产网站案例自己建站的网站
  • 英国人做愛无网站鸿星尔克网络营销
  • 网站搜索页面设计百度云
  • 怎么用手机做网站深圳seo优化公司哪家好
  • 做网站需要用什么技术太原seo网站排名