Skip to main content

Python module to segment the visible circular area of endoscopic images.

Project description

Description

Endoseg is a Python package that facilitates the segmentation of the visible circular area of endoscopic images.

Install dependencies

  • Numpy
# Ubuntu/Debian
$ sudo apt update
$ sudo apt install python3-pip
$ python3 -m pip install numpy --user
  • OpenCV
# Ubuntu/Debian
$ sudo apt update
$ sudo apt install libopencv-dev python3-opencv

Install with pip

$ python3 -m pip install endoseg --user

Install from source

$ git clone https://github.com/luiscarlosgph/endoseg.git
$ cd endoseg
$ python3 setup.py install --user

Run

$ git clone https://github.com/luiscarlosgph/endoseg.git
$ cd endoseg
$ python3 -m endoseg.run --input data/demo.jpg --output-seg data/demo_seg.png --output-crop data/demo_crop.jpg
Input image Output segmentation Output crop

Exemplary code snippet

# Read input image
im = cv2.imread('input_image.jpg', cv2.IMREAD_UNCHANGED)

# Segment the visible area of the endoscopic image
segmenter = endoseg.Segmenter()
seg = segmenter.segment(im)

# Save the segmentation to file
cv2.imwrite('output_segmentation.png', seg)

# Get a rectangular crop of the visible area
crop = segmenter.get_rect_crop(im)

# Save the crop to file
cv2.imwrite('output_crop.jpg', crop)

License

This code is released under an MIT license.

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

endoseg-0.4.0.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file endoseg-0.4.0.tar.gz.

File metadata

  • Download URL: endoseg-0.4.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for endoseg-0.4.0.tar.gz
Algorithm Hash digest
SHA256 562b951d8584c36c521cba96b66458214975d53c53828db0b1f4192172ef1dbe
MD5 5028efa5a685755e2a2219f444f0dee4
BLAKE2b-256 1611c886e1a647d1dbd225c18d72d641ad8c05e80aeb6d66736e7612e4d45ab6

See more details on using hashes here.

Supported by

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