Skip to main content

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

Note that the output crop is a square cut of the area within the segmentation mask.

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.

Metadata

Release files for endoseg 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for endoseg 0.6.0
File Size Uploaded Provenance Actions
endoseg-0.6.0.tar.gz 6.4 kB Without provenance Details for endoseg-0.6.0.tar.gz

Release files / endoseg-0.6.0.tar.gz

Download URL endoseg-0.6.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8837542fb1b62d65c4fce483819cca43f3a59c41ce05891ee904eeaddc6c93b3
BLAKE2b-256 checksum
How to use checksums
bf98267061a1937e81441492f605d07d7a6fda1939f38b6da9658347bdb21ca1
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for endoseg 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page