MIT License

项目介绍

mstorath/Pottslab 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 115 个 Star、17 次 Fork。

仓库全名
mstorath/Pottslab
开源许可证
MIT License
Star 数
115
Fork 数
17

README 摘要

Pottslab — Multilabel image segmentation via the Potts model Unsupervised multilabel image segmentation (colour, grayscale, multichannel) via the Potts model — also known as the piecewise-constant Mumford-Shah model or the ℓ⁰ gradient model. Solvers for 1-D denoising / step detection, 2-D image segmentation, and joint reconstruction-and-segmentation (deconvolution, Radon / MRI / PET). Featured in the MATLAB Central…

完整内容见 GitHub 原始 README 或本页 。

常见问题

Pottslab 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 115 个 Star。

Pottslab 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 Pottslab 的源码?

可以直接克隆仓库:git clone https://github.com/mstorath/Pottslab.git,默认分支为 master;安装与运行步骤见仓库 README。

Pottslab 最近还在维护吗?

仓库最近一次更新为 5月11日,当前没有未关闭的 Issue;Star 数为 115,可作为社区活跃度的参考。

关于

Unsupervised multilabel image segmentation (color/gray/multichannel) based on the Potts model (aka piecewise constant Mumford-Shah model)

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

语言占比

Java
Jupyter Notebook
MATLAB
Python
Rust
Wolfram Language

Release

README

Pottslab — Multilabel image segmentation via the Potts model

PyPI Python License: MIT MATLAB View Pottslab on File Exchange

Unsupervised multilabel image segmentation (colour, grayscale, multichannel) via the Potts model — also known as the piecewise-constant Mumford-Shah model or the ℓ⁰ gradient model. Solvers for 1-D denoising / step detection, 2-D image segmentation, and joint reconstruction-and-segmentation (deconvolution, Radon / MRI / PET).

Vector-valued segmentation

Featured in the MATLAB Central Pick of the Week (2017).

Quickstart

Python (Rust core)

pip install pottslab
import numpy as np
from pottslab import min_l2_potts, min_l2_potts_2d

# 1-D: denoise / step-detect a noisy piecewise-constant signal
y = np.array([0., 0.1, 0.05, 1.05, 0.95, 1.1, 0.0])
u = min_l2_potts(y, gamma=0.5)

# 2-D: segment a vector-valued image (H, W, C)
img = np.random.rand(64, 64, 3)
seg = min_l2_potts_2d(img, gamma=0.3)

The Python package wraps a Rust extension built with PyO3 and maturin; algorithm crates live under src/, demos under demos_python/. See README_PYTHON.md for the full Python API, inverse-Potts / sparsity / Tikhonov variants, and performance figures.

MATLAB

The original MATLAB / Java reference implementation is in this same repository:

  1. Run installPottslab.m to add the necessary folders to the MATLAB path.
  2. For best performance, increase Java heap space in the MATLAB preferences (MATLAB → General → Java Heap Memory).
  3. Run a demo from the Demos/ folder.
Troubleshooting
  • OutOfMemoryException — Increase Java heap space in the MATLAB preferences.
  • Undefined variable “pottslab” or class “pottslab.JavaTools.minL2Potts” — Run setPLJavaPath.m. You may also need to install Java 1.7 (see e.g. undocumentedmatlab.com).

Standalone (command line, plain image segmentation only)

java -jar pottslab-standalone.jar input output.png gamma

where gamma is a positive real number, e.g. 0.1 (thanks to fxtentacle).

Application examples

Segmentation of vector-valued images

  • Supports vector-valued images (multispectral, feature images)
  • Linear complexity in the number of channels
  • Label-free: no label discretisation required

Vector-valued segmentation

Left: A natural image. Right: Result using the Potts model.

Texture segmentation

Texture segmentation using high-dimensional curvelet-based feature vectors.

Used as the segmentation method in:

Joint image reconstruction and segmentation

  • Applicable to many imaging operators (convolution, Radon, MRI, PET, MPI) — only the proximal mapping is needed
  • Supports vector-valued data
  • Label-free: labels need not be chosen a priori

Phantom FBP Potts

Left: Shepp-Logan phantom. Centre: Filtered backprojection from 7 angular projections. Right: Joint reconstruction and segmentation using the Potts model from 7 angular projections.

Denoising / step detection of jump-sparse signals

  • L1 Potts model is robust to noise and to moderately blurred data
  • Fast and exact solver for the L1 Potts model
  • Approximative strategies for severely blurred data

Phantom

Top: Noisy signal. Bottom: Minimiser of the Potts functional (ground truth in red).

Used as the step-detection algorithm in:

Plugins for image-analysis GUIs

Parts of Pottslab can be used without MATLAB as pure Java plugins:

  • Icy plugin — interactive image segmentation based on Pottslab (Vasileios Angelopoulos).
  • ImageJ plugin — ImageJ frontend for Pottslab (Michael Kaul).

How to cite

If you use this software, please cite the relevant paper(s) below. GitHub’s “Cite this repository” button on the repo page reads the version and date-released fields from CITATION.cff and renders BibTeX/APA.

References

  • M. Storath, A. Weinmann, J. Frikel, M. Unser. Joint image reconstruction and segmentation using the Potts model, Inverse Problems, 2015.
  • A. Weinmann, M. Storath. Iterative Potts and Blake-Zisserman minimization for the recovery of functions with discontinuities from indirect measurements, Proceedings of the Royal Society A, 471(2176), 2015.
  • A. Weinmann, M. Storath, L. Demaret. The L1-Potts functional for robust jump-sparse reconstruction, SIAM Journal on Numerical Analysis, 2015.
  • M. Storath, A. Weinmann. Fast partitioning of vector-valued images, SIAM Journal on Imaging Sciences, 2014.
  • M. Storath, A. Weinmann, L. Demaret. Jump-sparse and sparse recovery using Potts functionals, IEEE Transactions on Signal Processing, 2014.

See also

Sibling projects from the same research program on variational methods for signal and image processing:

  • L1TV — exact L1-TV regularisation of real- or circle-valued signals
  • CSSD — cubic smoothing splines for signals with discontinuities
  • MumfordShah2D — edge-preserving image restoration via the Mumford-Shah model
  • CircleMedianFilter — fast median filtering for phase or orientation data
  • DCEBE — bolus arrival time estimation for DCE-MRI signals

Related external projects:

License

Released under the MIT License. See LICENSE.


Project history

The Python / Rust port of this codebase was generated from the original MATLAB / Java reference by a Claude coding agent in 2026. The agent also found and fixed an off-by-one bug in the weighted-median computation inside IndexedLinkedHistogram (in both the new Rust port and the original Java). See PORTED_BY.md for full attribution and the porting plan.

评论

暂无评论