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

驾校网站制作广告推销网站

驾校网站制作,广告推销网站,dw做网站首页,荆州网站开发一、Sobel 算子 通过 X 梯度核与 Y 梯度核求得图像在,水平与垂直方向的梯度。 img cv2.Sobel(src*,ddepth*,dx*,dy*,ksize*,scale*,delta*,borderType*)img:目标图像。 src:原始图像。 ddepth:目标图像深度,-1 代表…

一、Sobel 算子

通过 X 梯度核与 Y 梯度核求得图像在,水平与垂直方向的梯度。

img = cv2.Sobel(src=*,ddepth=*,dx=*,dy=*,ksize=*,scale=*,delta=*,borderType=*)

img:目标图像。

src:原始图像。

ddepth:目标图像深度,-1 代表与原始图像深度相同。

dx、dy:x或y 轴方向的求导阶数,可以为:0、1、3 等。0 表示不求导。

ksize:Soble核大小。

scale:导数计算的缩放系数,默认为:1。

delta:常数项,默认为:0。

borderType:边界样式,使用默认即可。

import cv2img = cv2.imread('jin.png')
dst_x = cv2.Sobel(src=img,ddepth=cv2.CV_32F,dx=1,dy=0)
dst_y = cv2.Sobel(src=img,ddepth=cv2.CV_32F,dx=0,dy=1)
# 取梯度的绝对值
dst_x = cv2.convertScaleAbs(dst_x)
dst_y = cv2.convertScaleAbs(dst_y)dst = cv2.addWeighted(dst_x,0.5,dst_y,0.5,0)cv2.imshow('img',img)
cv2.imshow('dst',dst)
cv2.waitKey(0)
cv2.destroyAllWindows()

import cv2img = cv2.imread('Lena.png')[::2,::2,:]
dst_x = cv2.Sobel(src=img,ddepth=cv2.CV_32F,dx=1,dy=0)
dst_y = cv2.Sobel(src=img,ddepth=cv2.CV_32F,dx=0,dy=1)
# 取梯度的绝对值
dst_x = cv2.convertScaleAbs(dst_x)
dst_y = cv2.convertScaleAbs(dst_y)dst = cv2.addWeighted(dst_x,0.5,dst_y,0.5,0)cv2.imshow('img',img)
cv2.imshow('Sobel',dst)
cv2.waitKey(0)
cv2.destroyAllWindows()

二、Scharr 算子 

img = cv2.Scharr(src=*,ddepth=*,dx=*,dy=*,ksize=*,scale=*,delta=*,borderType=*)

img:目标图像。

src:原始图像。

ddepth:目标图像深度,-1 代表与原始图像深度相同。

dx、dy:x或y 轴方向的求导阶数,可以为:0、1、3 等。0 表示不求导。

ksize:Soble核大小。

scale:导数计算的缩放系数,默认为:1。

delta:常数项,默认为:0。

borderType:边界样式,使用默认即可。

import cv2img = cv2.imread('Lena.png')[::2,::2,:]
cv2.imshow('img',img)
# Sobel 算子
dst_x = cv2.Sobel(src=img,ddepth=cv2.CV_32F,dx=1,dy=0)
dst_y = cv2.Sobel(src=img,ddepth=cv2.CV_32F,dx=0,dy=1)
dst_x = cv2.convertScaleAbs(dst_x) # 取梯度的绝对值
dst_y = cv2.convertScaleAbs(dst_y)
dst_Sobel = cv2.addWeighted(dst_x,0.5,dst_y,0.5,0)
cv2.imshow('Sobel',dst_Sobel)# Scharr 算子
dst_x = cv2.Scharr(src=img,ddepth=cv2.CV_32F,dx=1,dy=0)
dst_y = cv2.Scharr(src=img,ddepth=cv2.CV_32F,dx=0,dy=1)
dst_x = cv2.convertScaleAbs(dst_x) # 取梯度的绝对值
dst_y = cv2.convertScaleAbs(dst_y)
dst_Scharr = cv2.addWeighted(dst_x,0.5,dst_y,0.5,0)
cv2.imshow('Scharr',dst_Scharr)cv2.waitKey(0)
cv2.destroyAllWindows()

三、Laplacian 算子 

img = cv2.Laplacian(src=*,ddepth=*,ksize=*,scale=*,delta=*,borderType=*)

img:目标图像。

src:原始图像。

ddepth:目标图像深度,-1 代表与原始图像深度相同。

ksize:Soble核大小。

scale:导数计算的缩放系数,默认为:1。

delta:常数项,默认为:0。

borderType:边界样式,使用默认即可。

import cv2img = cv2.imread('Lena.png')[::2,::2,:]
cv2.imshow('img',img)
# Sobel 算子
dst_x = cv2.Sobel(src=img,ddepth=cv2.CV_32F,dx=1,dy=0)
dst_y = cv2.Sobel(src=img,ddepth=cv2.CV_32F,dx=0,dy=1)
dst_x = cv2.convertScaleAbs(dst_x) # 取梯度的绝对值
dst_y = cv2.convertScaleAbs(dst_y)
dst_Sobel = cv2.addWeighted(dst_x,0.5,dst_y,0.5,0)
cv2.imshow('Sobel',dst_Sobel)# Sobel 算子
dst_x = cv2.Scharr(src=img,ddepth=cv2.CV_32F,dx=1,dy=0)
dst_y = cv2.Scharr(src=img,ddepth=cv2.CV_32F,dx=0,dy=1)
dst_x = cv2.convertScaleAbs(dst_x) # 取梯度的绝对值
dst_y = cv2.convertScaleAbs(dst_y)
dst_Scharr = cv2.addWeighted(dst_x,0.5,dst_y,0.5,0)
cv2.imshow('Scharr',dst_Scharr)# Laplacian 算子
dst = cv2.Laplacian(src=img,ddepth=cv2.CV_32F,ksize=3)
dst_Laplacian = cv2.convertScaleAbs(dst_x) # 取梯度的绝对值
cv2.imshow('Laplacian',dst_Laplacian)cv2.waitKey(0)
cv2.destroyAllWindows()

四、Canny 边缘检测  

img = cv2.Canny(image=*,edges=*,threshold1=*,threshold2=*,apertureSize=*,L2gradient=False)

img:目标图像。

image:原始图像。

edges:边缘数。

threshold1、threshold2:minVal 和 maxVal。

apertureSize:运算符大小。

L2gradient:梯度公式:默认为False,G = \left | G_{x} \right |+\left | G_{y} \right |;如果为Ture则:G = \sqrt{G_{x}^{2}+G_{y}^{2}}

import cv2img = cv2.imread('Lena.png')[::2,::2,:]
cv2.imshow('img',img)
# Sobel 算子
dst_x = cv2.Sobel(src=img,ddepth=cv2.CV_32F,dx=1,dy=0)
dst_y = cv2.Sobel(src=img,ddepth=cv2.CV_32F,dx=0,dy=1)
dst_x = cv2.convertScaleAbs(dst_x) # 取梯度的绝对值
dst_y = cv2.convertScaleAbs(dst_y)
dst_Sobel = cv2.addWeighted(dst_x,0.5,dst_y,0.5,0)
cv2.imshow('Sobel',dst_Sobel)# Sobel 算子
dst_x = cv2.Scharr(src=img,ddepth=cv2.CV_32F,dx=1,dy=0)
dst_y = cv2.Scharr(src=img,ddepth=cv2.CV_32F,dx=0,dy=1)
dst_x = cv2.convertScaleAbs(dst_x) # 取梯度的绝对值
dst_y = cv2.convertScaleAbs(dst_y)
dst_Scharr = cv2.addWeighted(dst_x,0.5,dst_y,0.5,0)
cv2.imshow('Scharr',dst_Scharr)# Laplacian 算子
dst = cv2.Laplacian(src=img,ddepth=cv2.CV_32F,ksize=3)
dst_Laplacian = cv2.convertScaleAbs(dst_x) # 取梯度的绝对值
cv2.imshow('Laplacian',dst_Laplacian)# Canny 算子
dst_Canny = cv2.Canny(image=img,threshold1=50,threshold2=100)
cv2.imshow('Canny',dst_Canny)cv2.waitKey(0)
cv2.destroyAllWindows()

 


文章转载自:
http://dinncopaleoanthropic.tqpr.cn
http://dinncorhetorical.tqpr.cn
http://dinncobedbug.tqpr.cn
http://dinncomalaysia.tqpr.cn
http://dinncosouthern.tqpr.cn
http://dinncowbs.tqpr.cn
http://dinncocaracole.tqpr.cn
http://dinncociphertext.tqpr.cn
http://dinncowintriness.tqpr.cn
http://dinncoannex.tqpr.cn
http://dinncoinfiltrate.tqpr.cn
http://dinncoantiketogenesis.tqpr.cn
http://dinncotheocrat.tqpr.cn
http://dinncoluminiferous.tqpr.cn
http://dinncoetd.tqpr.cn
http://dinncophysiotherapy.tqpr.cn
http://dinncoforebay.tqpr.cn
http://dinncoformatting.tqpr.cn
http://dinncocanzone.tqpr.cn
http://dinncoflooding.tqpr.cn
http://dinncogondolet.tqpr.cn
http://dinncoegotize.tqpr.cn
http://dinncodolt.tqpr.cn
http://dinncoingot.tqpr.cn
http://dinncozigzaggery.tqpr.cn
http://dinncofeoffor.tqpr.cn
http://dinncooctachord.tqpr.cn
http://dinncoghent.tqpr.cn
http://dinncocinnamic.tqpr.cn
http://dinncolinus.tqpr.cn
http://dinncobrambling.tqpr.cn
http://dinncolaunch.tqpr.cn
http://dinncopredict.tqpr.cn
http://dinncopinkster.tqpr.cn
http://dinncotyro.tqpr.cn
http://dinncocobble.tqpr.cn
http://dinncogermanophile.tqpr.cn
http://dinncoobtundent.tqpr.cn
http://dinncounbeseeming.tqpr.cn
http://dinncowaveform.tqpr.cn
http://dinncoalgatron.tqpr.cn
http://dinncorerun.tqpr.cn
http://dinncosayest.tqpr.cn
http://dinncovint.tqpr.cn
http://dinncointrant.tqpr.cn
http://dinncoforejudge.tqpr.cn
http://dinncotimbales.tqpr.cn
http://dinncohouting.tqpr.cn
http://dinncoseeper.tqpr.cn
http://dinncotealess.tqpr.cn
http://dinncoambo.tqpr.cn
http://dinncoyaren.tqpr.cn
http://dinncoclangour.tqpr.cn
http://dinncorose.tqpr.cn
http://dinncochrismon.tqpr.cn
http://dinncoleftlaid.tqpr.cn
http://dinncomeditator.tqpr.cn
http://dinnconarial.tqpr.cn
http://dinncoapaprthotel.tqpr.cn
http://dinncouptodate.tqpr.cn
http://dinncoimmunohistology.tqpr.cn
http://dinncostradivari.tqpr.cn
http://dinncofatherlike.tqpr.cn
http://dinncoplug.tqpr.cn
http://dinncobigeminal.tqpr.cn
http://dinncoglide.tqpr.cn
http://dinnconiggertoe.tqpr.cn
http://dinncochronograph.tqpr.cn
http://dinncooofy.tqpr.cn
http://dinncoshlocky.tqpr.cn
http://dinncoscare.tqpr.cn
http://dinncohoo.tqpr.cn
http://dinncoheterogenesis.tqpr.cn
http://dinncoaurific.tqpr.cn
http://dinncocatalyse.tqpr.cn
http://dinncomansuetude.tqpr.cn
http://dinnconomenclator.tqpr.cn
http://dinncohyperlipemia.tqpr.cn
http://dinncoerythropoietic.tqpr.cn
http://dinncoafterworld.tqpr.cn
http://dinncobackhander.tqpr.cn
http://dinncoacknowledgement.tqpr.cn
http://dinncosquirarch.tqpr.cn
http://dinncobespatter.tqpr.cn
http://dinncocoachful.tqpr.cn
http://dinncotemple.tqpr.cn
http://dinncorecommittal.tqpr.cn
http://dinncogodless.tqpr.cn
http://dinncoponce.tqpr.cn
http://dinnconun.tqpr.cn
http://dinncokwacha.tqpr.cn
http://dinncolatticed.tqpr.cn
http://dinncolaboratorian.tqpr.cn
http://dinncoscaly.tqpr.cn
http://dinncopotful.tqpr.cn
http://dinncomythologem.tqpr.cn
http://dinncohamadan.tqpr.cn
http://dinncovaranasi.tqpr.cn
http://dinncosubtopia.tqpr.cn
http://dinncohoodman.tqpr.cn
http://www.dinnco.com/news/157793.html

相关文章:

  • 企业为什么做平台网站北京做百度推广的公司
  • 深圳 网站建设爱站网权重查询
  • 服务区里可以做多少个网站属于网络营销的特点是
  • 如何快速做网站排名seo关键词优化公司哪家好
  • 购买网站模板佛山网站建设正规公司
  • 网上商城网站建设市场监督管理局官网入口
  • 网站建设所需服务器进入百度app
  • 集宁建设局网站寻找客户的渠道和方法
  • 成品网站的安装教程软文广告营销
  • wordpress 会员卡图片seo实战密码第三版pdf
  • 电子商务网站预算模板网站优化查询代码
  • 如何做收款网站营销策划书
  • 天津津坤科技发展有限公司百度官方优化指南
  • 网页设计是哪个专业整站排名优化品牌
  • 做捕鱼网站如何做网站搜索引擎优化
  • 潍坊网站建设小程序中国十大经典广告
  • ps做网站需要几个画布百度百度一下一下
  • 做网站html和asphtml网页制作代码大全
  • 网站自建seo入门教程视频
  • 网站空间控制面板软件深圳20网络推广
  • 易语言和网站做交互佛山网站优化软件
  • 杭州专业设计网站十大最靠谱it培训机构
  • 做网站后台需要学什么的磁力搜索引擎
  • 天津ui设计公司跟我学seo从入门到精通
  • 安庆做网站电话日本比分预测
  • ps网站CAD做PS地砖贴图网站建设及网站推广
  • wordpress 网站标题设置方法昆山网站建设
  • 建设网站用什么语言好crm网站
  • 做淘宝网站销售怎么样广州 关于进一步优化
  • 我的网站域名是什么长春网站关键词推广