Skip to main content

A package used to segment an image

Project description

segment_image

Abstract

install

  • python >= 3.6
  • install
$ pip install segment-image

how to use

  • cv2need to be installed by pip install opencv-python

  • Kmeans

import segment_image
import cv2

img = cv2.imread("./sample_imgs/lena.png")
k = 2 # number of segments
k_means = segment_image.Kmeans(img, k)
iteration = 10
convergence_radius = 1e-6
k_means.run(iteration, convergence_radius)

  • gvf_snake (The speed is so slow, so I use small max_iteration_gvf and max_iteration_gvf. if you want to get great results, pleas adjust them)
import segment_image
import cv2

img = cv2.imread("./sample_imgs/star.png")
max_iteration_gvf = 10
max_iteration_snake = 10
gvf_snake = segment_image.GVFSnake(img, max_iteration_gvf, max_iteration_snake)
gvf_snake.run(save=True)

example

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

segment_image-0.0.3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

segment_image-0.0.3-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file segment_image-0.0.3.tar.gz.

File metadata

  • Download URL: segment_image-0.0.3.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.5

File hashes

Hashes for segment_image-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8e17fc69e6574f93f5f491caddcbd243d209354faa9d0dfe93c4c7d74f03cbbc
MD5 6d7400c97a0bcba3ccc3ccf23b0f7fd3
BLAKE2b-256 04f5b3fb8e1a304aaf34a85a7eb4104c3e3d704262094ab45c6642dad9fc0723

See more details on using hashes here.

File details

Details for the file segment_image-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: segment_image-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.5

File hashes

Hashes for segment_image-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e3e8604947a7d1a18460d9fc6e746f9ef3e45b4df02fc40cc5cbfd603849ce7b
MD5 0fc0a8c6b4f488eb9480ab2ecc841af7
BLAKE2b-256 7104e6c55b225df6c0e3990b0cf9161407d26ae12049f30435d3e34aefdd1bae

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