Skip to content

MyDuan/segment_image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages