Voronoi Label N dimensions

버전 1.0.1.1 (18.1 KB) 작성자: William Warriner
Tool for drawing an N-D Voronoi label matrix given a set of centroids.
다운로드 수: 40
업데이트 날짜: 2021/9/15

Voronoi Label N

Tool for drawing a Voronoi label matrix given a set of centroids. Creates an N-D Voronoi diagram label matrix from input centroid coordinates. May be used directly on pixel coordinate centroids, or used on arbitrary numeric coordinate centroids with args 2-4.

Two methods are available:

  1. "coordinates" - uses a compute- and memory-intensive direct computation of nearest centroid to each element. Labels all elements, biased towards smaller valued labels when there is a tie. Complexity is O(M*N*P) where M is the number of centroids, N is the number of dimensions, P is the number of elements in the output image. Suitable if Image Processing Toolbox is not available.
  2. "watershed" - uses a faster, less-memory-intensive computation using optimized image processing algorithms bwdist() and watershed(). Prefer this method if Image Processing Toolbox is available, it is about twice as fast.

Usage:

  1. Pixel coordinates, call with 1st arg only, or with 1st and 5th (args 2-4 empty arrays).
  2. Arbitrary coordinates, call with 2nd arg to give shape, 3rd to give origin and 4th to scale pixels/voxels.
% direct
labels = voronoi_labeln(centroids) % implied shape
labels = voronoi_labeln(centroids, shape) % explicit shape
labels = voronoi_labeln(centroids, shape, [], px_len) % scale
labels = voronoi_labeln(centroids, shape, origin, []) % translate
labels = voronoi_labeln(centroids, shape, origin, px_len) % both

% watershed
labels = voronoi_labels(centroids, [], [], [], "watershed")
labels = voronoi_labels(centroids, shape, [], [], "watershed")
% ... etc.

인용 양식

William Warriner (2024). Voronoi Label N dimensions (https://github.com/wwarriner/matlab_voronoi_labeln), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2021a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
1.0.1.1

Update title

1.0.1

Watershed now behaves identically to direct compute, and about twice as fast.

1.0.0.1

Added sample labelvolshow() image.

1.0.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.