Skip to main content

A fast library for image lowpoly generation based on centroid voronoi diagram

Project description

CVTLowpoly: Image Lowpoly via Centroid Voronoi Diagram

Image Sharp Feature Extraction using Guide Filter's Local Linear Theory via opencv-python.

The Following two parts are bollowed from https://github.com/songshibo/JumpFlooding-taichi

2D/3D Voronoi tessellation using Jump Flooding algorithm(JFA). Adopt 1+JFA strategy to reduce errors.

2D Centroidal Voronoi Tessellation using Lloyd algorithm.

Installation

The Python package can be installed with Pypi:

pip install CVTLowpoly

Usage

import cv2, CVTLowpoly
img = cv2.imread(filename, cv2.IMREAD_ANYCOLOR)

# case1: get triangle mesh
V, F, _sharp_image = CVTLowpoly.lowpoly_mesh(img)

# case2: get lowpoly image and triangle mesh
lowpoly_img, V, F, FColor = CVTLowpoly.lowpoly_image(img)

Results

  • Case 1: Source Image: 550x825(pixels: 453750), 1% sites
Source Image CVTLowpoly(iterations: 5, time: 1.7108s on MacPro2017 i5)
  • Case 2: Source Image: 550x828(pixels: 455400), 1% sites
Source Image CVTLowpoly(iterations: 5, time: 2.0708s on MacPro2017 i5)
  • Case 3: Source Image: 550x825(pixels: 453750), 1% sites
Source Image CVTLowpoly(iterations: 5, time: 0.7505s on MacPro2017 i5)
  • Case 4: Source Image: 1193x834(pixels: 994962), 1% sites
Source Image CVTLowpoly(iterations: 5, time: 2.889s on MacPro2017 i5)
  • Case 5: Source Image: 1193x834(pixels: 691200), 1% sites
Source Image CVTLowpoly(iterations: 5, time: 2.763s on MacPro2017 i5)

Reference

Jump flooding in GPU with applications to Voronoi diagram and distance transform

GPU-Assisted Computation of Centroidal Voronoi Tessellation

Variants of Jump Flooding Algorithm for Computing Discrete Voronoi Diagrams

JumpFlooding-taichi

Semi-Isotropic Triangular Image Lowpoly

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CVTLowpoly-1.0.2.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

CVTLowpoly-1.0.2-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file CVTLowpoly-1.0.2.tar.gz.

File metadata

  • Download URL: CVTLowpoly-1.0.2.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.0

File hashes

Hashes for CVTLowpoly-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a128a05e86becfe8379d20dfac1d9ac9ed061d68396eb1a775010bb484997bbf
MD5 c4523ae8daaee47fe30e4ac1748ba6e3
BLAKE2b-256 e49c45c2ebff3d1b0e54a4ee4a8dd26b207523bdd42df8ee38ca98b3085b5135

See more details on using hashes here.

File details

Details for the file CVTLowpoly-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: CVTLowpoly-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.0

File hashes

Hashes for CVTLowpoly-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 23eb1cbed1c99d14f22c02ff86caa48a62966a2cfaeb2073b8cf770c485c82e3
MD5 58374b7eca8eeaa6cc7392ee82d3b667
BLAKE2b-256 0fcf262b1cdf8677d4828ab710d9aef2683e6dd02f8dd091bde2b50202c8d64a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page