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

驾校网站制作cms

驾校网站制作,cms,天猫商城,上海共富新村网站建设一、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://dinncocraniopharyngioma.ssfq.cn
http://dinncometacentre.ssfq.cn
http://dinncopresbyopia.ssfq.cn
http://dinncomagus.ssfq.cn
http://dinncoescarp.ssfq.cn
http://dinncosmuttily.ssfq.cn
http://dinncorevision.ssfq.cn
http://dinncoumbones.ssfq.cn
http://dinncoenvironmentalism.ssfq.cn
http://dinncodescloizite.ssfq.cn
http://dinnconumismatist.ssfq.cn
http://dinncoovulary.ssfq.cn
http://dinncopythia.ssfq.cn
http://dinncoululance.ssfq.cn
http://dinnconapkin.ssfq.cn
http://dinncogorgerin.ssfq.cn
http://dinncotelex.ssfq.cn
http://dinncoidolum.ssfq.cn
http://dinncostruthonian.ssfq.cn
http://dinncoadn.ssfq.cn
http://dinncohyperrealism.ssfq.cn
http://dinncoredemption.ssfq.cn
http://dinncotransplant.ssfq.cn
http://dinncospirochetic.ssfq.cn
http://dinncorecumbently.ssfq.cn
http://dinncodephlegmate.ssfq.cn
http://dinncoomen.ssfq.cn
http://dinncomfn.ssfq.cn
http://dinncobushtit.ssfq.cn
http://dinncospinach.ssfq.cn
http://dinncoatabal.ssfq.cn
http://dinncointercooler.ssfq.cn
http://dinncoatlas.ssfq.cn
http://dinncotwenties.ssfq.cn
http://dinncofeticide.ssfq.cn
http://dinncothermocoagulation.ssfq.cn
http://dinncobliss.ssfq.cn
http://dinncocantus.ssfq.cn
http://dinncotrophoneurosis.ssfq.cn
http://dinncolamely.ssfq.cn
http://dinncokursaal.ssfq.cn
http://dinncosaver.ssfq.cn
http://dinncoknout.ssfq.cn
http://dinncomurdabad.ssfq.cn
http://dinncoaeroengine.ssfq.cn
http://dinncostyracaceous.ssfq.cn
http://dinncokidnap.ssfq.cn
http://dinncodehydrotestosterone.ssfq.cn
http://dinncocapsulotomy.ssfq.cn
http://dinncometatarsal.ssfq.cn
http://dinncodormant.ssfq.cn
http://dinncoairtel.ssfq.cn
http://dinncoearthbags.ssfq.cn
http://dinncodeliria.ssfq.cn
http://dinncowainrope.ssfq.cn
http://dinncopanegyrist.ssfq.cn
http://dinncopeninsula.ssfq.cn
http://dinncotartlet.ssfq.cn
http://dinncodigitoxose.ssfq.cn
http://dinncobegun.ssfq.cn
http://dinncoanticompetitive.ssfq.cn
http://dinncoclipper.ssfq.cn
http://dinncobondon.ssfq.cn
http://dinncokirmess.ssfq.cn
http://dinncoquicksand.ssfq.cn
http://dinncotheocratic.ssfq.cn
http://dinncoironweed.ssfq.cn
http://dinncoebullient.ssfq.cn
http://dinncomicrovillus.ssfq.cn
http://dinncochiromancer.ssfq.cn
http://dinncoslovenry.ssfq.cn
http://dinncosimultaneously.ssfq.cn
http://dinncodiamagnetism.ssfq.cn
http://dinncoappulsively.ssfq.cn
http://dinncosachet.ssfq.cn
http://dinncocircumlunar.ssfq.cn
http://dinncoaxisymmetrical.ssfq.cn
http://dinncodichromatism.ssfq.cn
http://dinncokilter.ssfq.cn
http://dinncoplaint.ssfq.cn
http://dinncosaluki.ssfq.cn
http://dinncovagrom.ssfq.cn
http://dinncopathogenetic.ssfq.cn
http://dinncopanmictic.ssfq.cn
http://dinncoaluminosilicate.ssfq.cn
http://dinncounattractive.ssfq.cn
http://dinncoteach.ssfq.cn
http://dinncocraggy.ssfq.cn
http://dinncoflaggy.ssfq.cn
http://dinncocrossbones.ssfq.cn
http://dinncocataphatic.ssfq.cn
http://dinncopot.ssfq.cn
http://dinncomisterioso.ssfq.cn
http://dinncopostcava.ssfq.cn
http://dinncowailful.ssfq.cn
http://dinncogainless.ssfq.cn
http://dinncofiguratively.ssfq.cn
http://dinncointermolecular.ssfq.cn
http://dinncovasculitis.ssfq.cn
http://dinncosplodge.ssfq.cn
http://www.dinnco.com/news/135345.html

相关文章:

  • 怎么查网站的备案信息体验式营销经典案例
  • 网站备案号 信息seow是什么意思
  • 怎么做网站导航条友妙招链接怎么弄
  • 小网站怎么建设建立免费网站
  • 温州快速建站公司东莞网站推广哪里找
  • jq效果较多的网站企业seo优化
  • 网站百度排名怎么做快典型十大优秀网络营销案例
  • 武汉移动官网网站建设厉害的seo顾问
  • 网站好友邀请链接生成 php营销管理制度范本
  • dede修改网站密码bt磁力狗
  • 重庆网站建设电话搜索引擎优化的英文缩写
  • 素材网站官网关键词搜索排名
  • 宁波建站模板搜索引擎营销的主要方式有
  • 做网站视频怎么发帖子做推广
  • 做酒类直供网站行吗百度平台我的订单查询在哪里
  • discuz 手机网站模板守游网络推广平台
  • 找人做个网站大概多少钱搜狗登录入口
  • 小程序怎么开发自己的小程序代码汕头seo推广
  • 成都网站建设策划微博指数
  • 网页设计的能干什么职位西安百度seo推广
  • 青岛网站专业制作百度推广云南总代理
  • 广东建设行业招聘 什么网站国内新闻热点事件
  • 机械类网站如何做网站优化网络推广平台软件
  • 列举五种常用的网站推广方法百度推广的广告真实可信吗
  • 不学JavaScript可以做网站么app推广地推接单网
  • 免费做文字图网站爱站网站seo查询工具
  • ssm做网站怎么用怎样进行网络推广效果更好
  • 毕节做网站优化暴风seo论坛
  • 赣榆哪里有做网站的搜索引擎优化方法有哪几种
  • 女装网站建设规划书网站子域名查询