# scikit-image

**scikit-image**（导入时写作 `skimage`）是 [Python](https://www.edgepedia.org/zh/python-programming-language) 编程语言中一个开源的图像处理算法集合，其设计目标是直接对 NumPy 数组进行运算。它免费且不受使用限制，以“修改版 BSD”许可证发布，由一个活跃的国际志愿者社区开发，该社区强调高质量的、经过同行评审的代码。<sup>[1](https://scikit-image.org/)</sup><sup> • </sup><sup>[2](https://arxiv.org/abs/1407.6245)</sup> 该库被用于研究、教育和工业应用，包括显微成像、天文学及其他科学成像领域。<sup>[2](https://arxiv.org/abs/1407.6245)</sup>

| 关键事实 | 详情 |
|---|---|
| 是什么 | 面向 Python 的图像处理算法集合，原生操作 NumPy 数组<sup>[1](https://scikit-image.org/)</sup><sup> • </sup><sup>[3](https://scipy-lectures.org/_downloads/ScipyLectures-simple.pdf)</sup> |
| 许可证 | “修改版 BSD”开源许可证；免费且不受限制<sup>[2](https://arxiv.org/abs/1407.6245)</sup><sup> • </sup><sup>[1](https://scikit-image.org/)</sup> |
| 标准引用 | van der Walt, Schönberger, Nunez-Iglesias, Boulogne, Warner, Yager, Gouillart, Yu 及贡献者，*PeerJ* 2:e453 (2014)<sup>[1](https://scikit-image.org/)</sup> |
| 当前版本 | 0.26.0，发布于 2025-12-20；要求至少 Python 3.11<sup>[4](https://scikit-image.org/docs/stable/release_notes/release_0.26.html)</sup><sup> • </sup><sup>[5](https://scikit-image.org/docs/stable/user_guide/install.html)</sup> |
| 图像表示 | 图像即 NumPy 数组；uint8 范围为 0–255，浮点图像限制在 −1 到 1<sup>[6](https://scikit-image.org/docs/stable/user_guide/data_types.html)</sup> |
| 治理 | NumFOCUS 的赞助项目；开发在 GitHub 上协调<sup>[7](https://numfocus.org/wp-content/uploads/2022/03/scikit-image-OnePager.pdf)</sup><sup> • </sup><sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC4081273/)</sup> |
| 下一代 | 团队正在开发 scikit-image v2，称其是一次重大革新，将提供更简洁、更直观的 API<sup>[1](https://scikit-image.org/)</sup> |

## 设计：图像即 NumPy 数组

该库的核心约定是：图像就是一个 NumPy 数组，因此普通的数组操作、切片以及更广泛的科学 Python 工具链都可以直接作用于图像，无需转换。<sup>[6](https://scikit-image.org/docs/stable/user_guide/data_types.html)</sup><sup> • </sup><sup>[3](https://scipy-lectures.org/_downloads/ScipyLectures-simple.pdf)</sup> 这种“图像就是 NumPy 数组”的理念也是该项目教程的组织原则，教程即以此为基础介绍滤波器、形态学和分割。<sup>[9](https://www.youtube.com/watch?v=arXiv-TM7DY)</sup>

**数据类型与范围。** 为避免扭曲图像强度，scikit-image 对每种 dtype 假定了特定的取值范围：uint8 图像范围为 0 到 255，uint16 范围为 0 到 65535，浮点图像应限制在 −1 到 1 之间，尽管浮点类型本身可以超出该范围；除少数例外，不支持 64 位 (u)int 图像。<sup>[6](https://scikit-image.org/docs/stable/user_guide/data_types.html)</sup> 由于函数返回的 dtype 可能与接受的 dtype 不同，该包提供了能正确重新缩放强度的转换工具，如 `img_as_float`、`img_as_ubyte`、`img_as_uint` 和 `img_as_int`；用户被警告绝不要直接对图像使用 `astype`，因为这会违反 dtype 范围的假定。<sup>[6](https://scikit-image.org/docs/stable/user_guide/data_types.html)</sup> 当数组值代表物理测量值（如温度或降雨量）而不应被重新缩放时，可以使用 `preserve_range` 参数。<sup>[6](https://scikit-image.org/docs/stable/user_guide/data_types.html)</sup>

## 功能

示例库将该库的范围按应用领域组织，包括：<sup>[10](https://scikit-image.org/docs/stable/auto_examples/)</sup>

- **曝光与色彩**：RGB 转灰度和 HSV 转换、直方图均衡化、局部和三维自适应直方图均衡化、伽马和对数对比度调整，以及直方图匹配。
- **边缘、线条与变换**：[Canny 边缘检测器](https://www.edgepedia.org/zh/canny-edge-detector)、轮廓查找、Hough 变换、骨架化、重缩放/调整大小/降采样、分段仿射和薄板样条变形，以及 Radon 变换。
- **滤波与复原**：均值滤波、反锐化掩模、去卷积、小波和非局部均值去噪、图像修复，以及相位解缠。
- **特征检测**：SIFT、ORB、BRIEF、DAISY、CENSURE、类 Haar 特征、方向梯度直方图、模板匹配，以及斑点和角点检测。
- **分割与配准**：阈值处理、区域邻接图、归一化割、基于边缘与基于区域的分割比较、图像配准、光流，以及拼接。

若干较长的示例直接面向科学工作流，例如估计三维显微图像中的各向异性、测量核膜处的荧光强度、分割有丝分裂中的人体细胞、追踪金属合金的凝固过程，以及交互操作肾脏组织的三维图像。<sup>[10](https://scikit-image.org/docs/stable/auto_examples/)</sup> 项目主页上的一个最小用法示例加载一张内置示例图像，并用四行代码应用 Sobel 边缘滤波器，使用 `ski.data.coins()` 和 `ski.filters.sobel()`。<sup>[1](https://scikit-image.org/)</sup>

## 实践中的分割

用户指南的分割教程展示了该库各组件如何组合。它将图像分割定义为给感兴趣对象的像素打标签，并使用内置的硬币图像，该图像显示在较暗背景上勾勒出的硬币。简单的阈值处理在此失败，因为不均匀的光照使背景与硬币共享足够多的灰度级，导致硬币的某些部分丢失或背景与硬币融合；教程的第一个补救方法是利用局部对比度，即使用图像梯度而非灰度值。<sup>[11](https://github.com/scikit-image/scikit-image/blob/main/doc/source/user_guide/tutorial_segmentation.rst)</sup>

## 历史与版本

该项目最初名为 **scikits.image**，0.3 版日期为 2011-10-10，随后在 2012 年和 2013 年初发布了 scikits-image 0.4 至 0.8，之后名称定为 scikit-image。<sup>[12](https://scikit-image.org/docs/stable/release_notes/index.html)</sup> 经同行评审的描述论文《scikit-image：Python 中的图像处理》于 2014 年发表在 *PeerJ* 上，至今仍是该项目要求引用的文献。<sup>[1](https://scikit-image.org/)</sup><sup> • </sup><sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC4081273/)</sup>

开发工作由一个开放社区承担，成员在 GitHub 上协作进行问题跟踪、代码审查和发布管理。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC4081273/)</sup> scikit-image 是 NumFOCUS 的赞助项目，并于 2022 年 11 月通过 CZI 第五轮“必要开源软件”资助周期获得资金，用于创建一个类型化、可发现且可扩展的 API。<sup>[7](https://numfocus.org/wp-content/uploads/2022/03/scikit-image-OnePager.pdf)</sup><sup> • </sup><sup>[1](https://scikit-image.org/)</sup>

近期版本发布节奏稳定：0.22.0（2023-10-03）、0.24.0（2024-06-18）、0.25.2（2025-02-18）和 0.26.0（2025-12-20）。<sup>[1](https://scikit-image.org/)</sup> 0.26.0 版放弃了对 Python 3.10 的支持，为 `skimage.graph.MCP.find_costs` 添加了 `max_step_cost` 参数，为 `skimage.measure.regionprops` 添加了 `intensity_median` 属性，并弃用了单独的 `binary_erosion`、`binary_dilation`、`binary_opening` 和 `binary_closing` 函数，转而使用通用的 `erosion`、`dilation`、`opening` 和 `closing`，理由是二值版本并没有显著更快，有时反而显著更慢。<sup>[4](https://scikit-image.org/docs/stable/release_notes/release_0.26.html)</sup> 安装当前版本需要至少 Python 3.11。<sup>[5](https://scikit-image.org/docs/stable/user_guide/install.html)</sup>

## 与其他库的关系

scikit-image 与 NumPy 和 SciPy 一同位于科学 Python 工具链中；SciPy 的 `scipy.ndimage` 模块提供多维图像处理，而 scikit-image 设计为与两者互操作。<sup>[13](https://docs.scipy.org/doc/scipy/tutorial/)</sup><sup> • </sup><sup>[3](https://scipy-lectures.org/_downloads/ScipyLectures-simple.pdf)</sup> 与 OpenCV 的互换有文档记载：OpenCV 以 BGR 通道顺序而非 scikit-image 的 RGB 存储彩色图像，且默认使用 uint8，因此转换就是通道反转（`image[:, :, ::-1]`）加上通常的 dtype 工具。<sup>[6](https://scikit-image.org/docs/stable/user_guide/data_types.html)</sup> 比较性综述将 scikit-image 与 OpenCV、Pillow、SimpleITK 和 Mahotas 一同列为主要 Python 图像处理库，其中 scikit-image 被描述为一个相当简单、直接的包，可与 NumPy 数组配合工作。<sup>[14](https://ia-res.ethz.ch/courses/iaf/Python.pdf)</sup><sup> • </sup><sup>[15](https://research-api.cbs.dk/ws/portalfiles/portal/71022095/xiaohui_liu_et_al_image_analytics_acceptedversion.pdf)</sup>

## 学习资源

除示例库外，该项目还维护一个单独的教程仓库，包含 Jupyter 笔记本，可在本地或通过 MyBinder 运行，涵盖基本操作和真实世界分析问题；这些材料以知识共享 CC0 1.0 协议贡献至公有领域，并请求下游用户注明出处。<sup>[16](https://scikit-image.org/skimage-tutorials/README.html)</sup> 示例库中面向开发者的示例解释了特定算法的内部工作原理，如 Li 阈值法和最大树，供现有或潜在贡献者参考。<sup>[10](https://scikit-image.org/docs/stable/auto_examples/)</sup>

## References

1. [scikit-image: Image processing in Python — project home page](https://scikit-image.org/)
2. [van der Walt et al. (2014). scikit-image: Image processing in Python. arXiv:1407.6245; published in PeerJ 2:e453](https://arxiv.org/abs/1407.6245)
3. [Scipy Lectures: scikit-image chapter](https://scipy-lectures.org/_downloads/ScipyLectures-simple.pdf)
4. [scikit-image 0.26.0 (2025-12-20) release notes](https://scikit-image.org/docs/stable/release_notes/release_0.26.html)
5. [Installing scikit-image — skimage 0.26.0 documentation](https://scikit-image.org/docs/stable/user_guide/install.html)
6. [Image data types and what they mean — skimage 0.26.0 documentation](https://scikit-image.org/docs/stable/user_guide/data_types.html)
7. [NumFOCUS scikit-image one-pager (Applications)](https://numfocus.org/wp-content/uploads/2022/03/scikit-image-OnePager.pdf)
8. [scikit-image: image processing in Python, PeerJ (PMC4081273)](https://pmc.ncbi.nlm.nih.gov/articles/PMC4081273/)
9. [Image Analysis in Python with SciPy and scikit-image, SciPy 2018 Tutorial (Enthought)](https://www.youtube.com/watch?v=arXiv-TM7DY)
10. [Examples — skimage 0.26.0 documentation](https://scikit-image.org/docs/stable/auto_examples/)
11. [Image Segmentation tutorial, scikit-image user guide source](https://github.com/scikit-image/scikit-image/blob/main/doc/source/user_guide/tutorial_segmentation.rst)
12. [Release notes index — skimage 0.26.0 documentation](https://scikit-image.org/docs/stable/release_notes/index.html)
13. [SciPy User Guide, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/tutorial/)
14. [Image Analysis Fundamentals in Python (ETH Zurich course notes)](https://ia-res.ethz.ch/courses/iaf/Python.pdf)
15. [Table 6. Common Image Processing Libraries in Python (accepted manuscript)](https://research-api.cbs.dk/ws/portalfiles/portal/71022095/xiaohui_liu_et_al_image_analytics_acceptedversion.pdf)
16. [scikit-image tutorials — Image analysis in Python](https://scikit-image.org/skimage-tutorials/README.html)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Language and vision AI › Computer vision › Vision datasets, software, and community › CV software and toolkits

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/scikit-image

English original: https://www.edgepedia.org/scikit-image
