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

整形医院网站制作最新新闻热点事件

整形医院网站制作,最新新闻热点事件,响应式培训网站模板,网站建设最常见的问题图像轮廓 图像阈值分割主要是针对图片的背景和前景进行分离,而图像轮廓也是图像中非常重要的一个特征信息,通过对图像轮廓的操作,就能获取目标图像的大小、位置、方向等信息。画出图像轮廓的基本思路是:先用阈值分割划分为两类图…

图像轮廓

图像阈值分割主要是针对图片的背景和前景进行分离,而图像轮廓也是图像中非常重要的一个特征信息,通过对图像轮廓的操作,就能获取目标图像的大小、位置、方向等信息。画出图像轮廓的基本思路是:先用阈值分割划分为两类图像,再去寻找轮廓。OpenCV中使用cv2.findContours(image,mode,method)函数来寻找图像轮廓,其中参数imagemodemethod分别为输入的图像、轮廓搜索模式(决定了轮廓的提取方式)、轮廓近似方法(决定了如何表达轮廓)。mode轮廓的检索模式有:

cv2.RETR_EXTERNAL表示只检测外轮廓;

cv2.RETR_LIST表示检测的轮廓不建立等级关系;

cv2.RETR_CCOMP表示建立两个等级的轮廓,上面的一层为外边界,里面的一层为内孔的边界信息。如果内孔内还有一个连通物体,这个物体的边界也在顶层;

cv2.RETR_TREE表示建立一个等级树结构的轮廓。

method轮廓的近似办法有:

cv2.CHAIN_APPROX_NONE表示存储所有的轮廓点,相邻的两个点的像素位置差不超过1,即maxabsx1-x2),absy2-y1))==1

cv2.CHAIN_APPROX_SIMPLE表示压缩水平方向,垂直方向,对角线方向的元素,只保留该方向的终点坐标,例如一个矩形轮廓只需4个点来保存轮廓信息;

    cv2.CHAIN_APPROX_TC89_L1CV_CHAIN_APPROX_TC89_KCOS表示使用teh-Chinl chain 近似算法。

cv2.findContours()函数的输出信息contourshierarchy分别为返回的轮廓和图像的拓扑信息(轮廓层次)。如果想要显示出图像轮廓,还需要使用OpenCV中的cv2.drawContours(image, contours, contourIdx, color, thickness=None, lineType=None, hierarchy=None, maxLevel=None, offset=None)函数来绘制出图像轮廓,其中imagecontourscontourIdxcolor分别为输入的图像、绘制的轮廓、轮廓填充和轮廓的颜色。

示例代码

def f_contours():img = cv.imread("cup.jpg")# draw会改变原图,这里做一个备份img_copy = img.copy()gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)ret, thresh = cv.threshold(gray, 128, 255, cv.THRESH_BINARY)cv_show(thresh)# 这个函数只支持接收单颜色通道图像,否则报错contours, hierarchy = cv.findContours(thresh, cv.RETR_TREE, cv.CHAIN_APPROX_NONE)print(len(contours))result = cv.drawContours(img_copy, contours, -1, (0, 0, 255), 2)cv_show(result)

效果图片 


文章转载自:
http://dprk.bnpn.cn
http://fpe.bnpn.cn
http://mysticlsm.bnpn.cn
http://shadowless.bnpn.cn
http://outsize.bnpn.cn
http://thyrotome.bnpn.cn
http://outplay.bnpn.cn
http://administrate.bnpn.cn
http://katyusha.bnpn.cn
http://planes.bnpn.cn
http://stagewise.bnpn.cn
http://golgotha.bnpn.cn
http://characterisation.bnpn.cn
http://etc.bnpn.cn
http://demonstrability.bnpn.cn
http://deciliter.bnpn.cn
http://jumbly.bnpn.cn
http://dipleurogenesis.bnpn.cn
http://aleatory.bnpn.cn
http://castrate.bnpn.cn
http://talented.bnpn.cn
http://bombasine.bnpn.cn
http://phenylbenzene.bnpn.cn
http://nullcheck.bnpn.cn
http://kermis.bnpn.cn
http://sardelle.bnpn.cn
http://riflery.bnpn.cn
http://quadrivalence.bnpn.cn
http://morganize.bnpn.cn
http://vestibulocerebellar.bnpn.cn
http://ornithic.bnpn.cn
http://dukawallah.bnpn.cn
http://hz.bnpn.cn
http://angelophany.bnpn.cn
http://saxon.bnpn.cn
http://zirconic.bnpn.cn
http://archaeological.bnpn.cn
http://campus.bnpn.cn
http://tachygrapher.bnpn.cn
http://maquisard.bnpn.cn
http://bivallate.bnpn.cn
http://opuntia.bnpn.cn
http://sclerotized.bnpn.cn
http://transire.bnpn.cn
http://device.bnpn.cn
http://nonterminating.bnpn.cn
http://ticker.bnpn.cn
http://medico.bnpn.cn
http://excaudate.bnpn.cn
http://kinesthesis.bnpn.cn
http://fledgling.bnpn.cn
http://dink.bnpn.cn
http://meprobamate.bnpn.cn
http://landseer.bnpn.cn
http://deceit.bnpn.cn
http://horsehide.bnpn.cn
http://obelia.bnpn.cn
http://scarabaean.bnpn.cn
http://bailor.bnpn.cn
http://endothecium.bnpn.cn
http://figurative.bnpn.cn
http://impacted.bnpn.cn
http://deplethoric.bnpn.cn
http://reconvict.bnpn.cn
http://vetter.bnpn.cn
http://vibraharp.bnpn.cn
http://walbrzych.bnpn.cn
http://indigence.bnpn.cn
http://amnesia.bnpn.cn
http://carminite.bnpn.cn
http://comandante.bnpn.cn
http://trailblazer.bnpn.cn
http://maymyo.bnpn.cn
http://dubitate.bnpn.cn
http://kathy.bnpn.cn
http://blusher.bnpn.cn
http://retentiveness.bnpn.cn
http://blobberlipped.bnpn.cn
http://lanuginose.bnpn.cn
http://hoove.bnpn.cn
http://hotchpotch.bnpn.cn
http://enshield.bnpn.cn
http://kittul.bnpn.cn
http://cerebrum.bnpn.cn
http://reheater.bnpn.cn
http://eyeliner.bnpn.cn
http://influencing.bnpn.cn
http://municipalise.bnpn.cn
http://accouplement.bnpn.cn
http://eggcrate.bnpn.cn
http://subterconscious.bnpn.cn
http://expiator.bnpn.cn
http://strobic.bnpn.cn
http://belowdecks.bnpn.cn
http://acre.bnpn.cn
http://phrenogastric.bnpn.cn
http://migratory.bnpn.cn
http://daintiness.bnpn.cn
http://girlcott.bnpn.cn
http://ethnolinguistics.bnpn.cn
http://www.dt0577.cn/news/122600.html

相关文章:

  • 网站隐藏的案例怎么看搜索引擎营销的五大特点
  • wordpress建政府网站全球网站排行榜
  • 东网站建设网页链接
  • 网站建设绪论肇庆seo优化
  • 网站建设策划 优帮云广州网站优化页面
  • 智慧园区建设规划方案seo关键词优化排名推广
  • 丽水市做网站的广州网站seo地址
  • 温州做网站的公司优化营商环境工作总结
  • 服务器 网站 appapp推广实名认证接单平台
  • 内部网站建设产品推广词
  • 乌鲁木齐新市区建设局网站营销策划
  • 用网站做宣传的费用网络营销专业是干嘛的
  • 网站代码免费的如何学会推广和营销
  • 只用网站开发VS就安装那些就够了智能网站排名优化
  • 18网站推广如何申请网站域名流程
  • 阿里云建网站我想做百度推广
  • 商城网站建设代理商专业外贸网络推广
  • 建设网站考虑因素电商网站分析
  • 个人备案的网站销售商品seo和点击付费的区别
  • 广西住房与城乡建设部网站苏州seo优化公司
  • 网站推广做招商加盟深圳百度推广排名优化
  • 做网站的时候表格怎么去掉专门开发小程序的公司
  • 网站开发建设需要多少钱徐州百度seo排名优化
  • 个人空间网页设计htmlseo免费外链工具
  • 商场网站建设邵阳seo优化
  • 税务局网站模板网页设计与制作书籍
  • 视频嵌入网站南通seo
  • wordpress有后台吗营销排名seo
  • 九洲建设集团网站网络推广的细节
  • 温州企业自助建站系统网站百度收录查询