我们使用行进正方形方法找到图像中的常值轮廓
函数:
#Find contours at a constant value of 0.8
contours = measure.find_contours(r, 0.8)

使用它,需要:from skimage import measure

"""
===============
Contour finding
===============We use a marching squares method to find constant valued contours in an image.
In ``skimage.measure.find_contours``, array values are linearly interpolated
to provide better precision of the output contours. Contours which intersect
the image edge are open; all others are closed.The `marching squares algorithm
<http://www.essi.fr/~lingrand/MarchingCubes/algo.html>`__ is a special case of
the marching cubes algorithm (Lorensen, William and Harvey E. Cline. Marching
Cubes: A High Resolution 3D Surface Construction Algorithm. Computer Graphics
(SIGGRAPH 87 Proceedings) 21(4) July 1987, p. 163-170)."""
import numpy as np
import matplotlib.pyplot as pltfrom skimage import measure# Construct some test data
x, y = np.ogrid[-np.pi:np.pi:100j, -np.pi:np.pi:100j]
r = np.sin(np.exp((np.sin(x)**3 + np.cos(y)**2)))# Find contours at a constant value of 0.8
contours = measure.find_contours(r, 0.8)# Display the image and plot all contours found
fig, ax = plt.subplots()
ax.imshow(r, cmap=plt.cm.gray)for n, contour in enumerate(contours):ax.plot(contour[:, 1], contour[:, 0], linewidth=2, color='red')ax.axis('image')
ax.set_xticks([])
ax.set_yticks([])
plt.show()

python库skimage 常值轮廓寻找并标记相关推荐

  1. 使用Python,OpenCV沿着轮廓寻找极值点

    使用Python,OpenCV沿着轮廓寻找极值点 这篇博客将介绍如何使用Python,OpenCV沿着轮廓寻找极值点,找到最北.最南.最东和最西(x,y)坐标.虽然这项技能本身并不有用,但它通常被用作 ...

  2. python库skimage 将针对灰度图像的滤波器用于RGB图像

    有许多滤波器设计用于灰度图像但是不能用于彩色图像.为了简化创建函数,使其能够用于RGB图像,scikit-image图像处理库提供了adapt_rgb装饰器. 实际使用adapt_rgb装饰器,你必须 ...

  3. python库skimage 绘制二值图像的凸壳

    二值图像的凸壳指的是包围输入二值图像白色区域的最小的凸多边形的像素集合. skimage中的函数 from skimage.morphology import convex_hull_image ch ...

  4. python库skimage 图像直方图均衡化、自适应均衡化、对比度拉伸实现

    直方图全局均衡化 from skimage import exposure # Equalization img_eq = exposure.equalize_hist(img) 直方图自适应均衡化 ...

  5. python库skimage 图像直方图局部均衡化

    函数 from skimage import exposure from skimage.morphology import disk from skimage.filters import rank ...

  6. python库skimage 绘制直方图;绘制累计直方图;实现直方图匹配(histogram matching)

    绘制直方图 from skimage import exposure # 绘制彩色图像的c通道的直方图 img_hist, bins = exposure.histogram(img[..., c], ...

  7. CV:计算机视觉技术之图像基础知识(二)—以python的skimage和numpy库来了解计算机视觉图像基础(图像存储原理-模糊核-锐化核-边缘检测核,进阶卷积神经网络(CNN)的必备基础)

    CV:计算机视觉技术之图像基础知识(二)-以python的skimage和numpy库来了解计算机视觉图像基础(图像存储原理-模糊核-锐化核-边缘检测核,进阶卷积神经网络(CNN)的必备基础) 目录 ...

  8. Py之skimage:Python库之skimage的简介、安装、使用方法之详细攻略

    Py之skimage:Python库之skimage的简介.安装.使用方法之详细攻略 目录 skimage的简介 skimage的安装 skimage的使用方法 skimage的简介 skimage即 ...

  9. Py之scikit-image:Python库之skimage的简介、安装、使用方法之详细攻略

    Py之scikit-image:Python库之skimage的简介.安装.使用方法之详细攻略 目录 skimage的简介 1.skimage包由许多的子模块组成,各个子模块提供不同的功能 skima ...

最新文章

  1. 【转】How Many Boyfriends
  2. android 模拟点击localinstrumentation,Android Instrumentation模拟鼠标点击事件
  3. 码农们不得不重视的问题
  4. 设置让php能够以root权限来执行exec() 或者 shell_exec()
  5. 【theano-windows】学习笔记十——多层感知机手写数字分类
  6. Productivity Power Tools 动画演示(转)
  7. 使用NFS搭建WEB服务器集群
  8. 如何在阿里云里申请并使用免费https证书SSL、nginx下配置https证书
  9. rv1126 固件编译规则
  10. 当你爸妈吐槽你的微信头像时,你该如何反击?
  11. 我爱过你吗--我看美丽心灵的永恒阳光
  12. ROS PGM格式文件详解 | 九七的ROS
  13. 微信客户端如何发只有纯文字 不带图片的朋友圈动态
  14. 低代码行业风涌云起,他们靠什么跻身全球第一阵营?
  15. 如何快速关联/ 修改 Git 远程仓库地址
  16. 1118: 继续畅通工程
  17. 名片管理系统(构建可进不可退的多级从菜单名单系统)
  18. 晨跑、午后跑和夜跑对身体的影响及优缺点
  19. 【设计】宽范围输入线性稳压器
  20. LIGO找到首个超越广义相对论的证据?

热门文章

  1. 零基础学python-如何零基础开始自学Python编程
  2. python手机版-QPython3手机版下载
  3. 自学python好找工作么-学习python后好找工作吗
  4. python从入门到放弃 图-python从入门到放弃(二)
  5. 通过重新训练语音识别来改善iPhone上的嘿Siri | MOS86
  6. 数据库服务器备份日志文件,数据库服务器备份日志文件
  7. nvm切换node版本的命令
  8. 12v电源正负极区分_UPS不间断电源的安装、配电计算及相关故障处理方法!
  9. 使用 k8s 搭建 confluence 6.10.x 版本
  10. 数据库中系统数据库服务器,sql中什么是系统数据库服务器