# Tree Disk Segmentation
[![PyPI - Version](https://img.shields.io/pypi/v/tree-disk-segmentation)](https://pypi.org/project/tree-disk-segmentation/)
A Python package for analyzing tree rings in cross-sectional images.
## Installation
```bash
pip install tree-disk-segmentation
```
## Usage
### Python API
```python
import treedisksegmentation
# Configure the analyzer
treedisksegmentation.configure(
input_image="input/tree-disk4.png",
save_results=True,
)
# Run the analysis
(
img_in, # Original input image
img_pre, # Preprocessed image
devernay_edges, # Detected edges
devernay_curves_f, # Filtered curves
devernay_curves_s, # Smoothed curves
devernay_curves_c, # Connected curves
devernay_curves_p, # Final processed curves
) = treedisksegmentation.run()
```
### Command Line Interface (CLI)
Basic usage:
```bash
tree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output/output.jpg
```
Save intermediate results:
```bash
tree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output/output.jpg --model_path ./models/u2net.pth --save_results
```
## CLI Arguments
| Argument | Type | Required | Default | Description |
|----------|------|----------|---------|-------------|
| `--input_image` | str | Yes | - | Path to input image |
| `--output_dir` | str | No | `./output` | Output directory path |
| `--model_path` | str | No | `./models/u2net.pth` | Path to the pre-trained model weights |
| `--debug` | flag | No | False | Enable debug mode |
| `--save_results` | flag | No | False | Save intermediate images, labelme and config file |
## Development
### Setting up Development Environment
1. Clone the repository:
```bash
git clone https://github.com/tuke307/tree-disk-segmentation.git
cd tree-disk-segmentation
```
2. Create and activate virtual environment:
```bash
poetry install
poetry shell
```
Raw data
{
"_id": null,
"home_page": "https://github.com/tuke307/tree-disk-segmentation",
"name": "tree-disk-segmentation",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "tree, segmentation, image processing",
"author": "Tony",
"author_email": "tonymeissner70@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a2/c4/2dbbf2d27275e28217c8a0a64ff8b7036bc3b6094d89fe9bf5336a98634b/tree_disk_segmentation-0.1.3.tar.gz",
"platform": null,
"description": "# Tree Disk Segmentation\n\n[![PyPI - Version](https://img.shields.io/pypi/v/tree-disk-segmentation)](https://pypi.org/project/tree-disk-segmentation/)\n\nA Python package for analyzing tree rings in cross-sectional images.\n\n## Installation\n\n```bash\npip install tree-disk-segmentation\n```\n\n## Usage\n\n### Python API\n\n```python\nimport treedisksegmentation\n\n# Configure the analyzer\ntreedisksegmentation.configure(\n input_image=\"input/tree-disk4.png\",\n save_results=True,\n)\n\n# Run the analysis\n(\n img_in, # Original input image\n img_pre, # Preprocessed image\n devernay_edges, # Detected edges\n devernay_curves_f, # Filtered curves\n devernay_curves_s, # Smoothed curves\n devernay_curves_c, # Connected curves\n devernay_curves_p, # Final processed curves\n) = treedisksegmentation.run()\n```\n\n### Command Line Interface (CLI)\n\nBasic usage:\n```bash\ntree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output/output.jpg\n```\n\nSave intermediate results:\n```bash\ntree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output/output.jpg --model_path ./models/u2net.pth --save_results\n```\n\n## CLI Arguments\n\n| Argument | Type | Required | Default | Description |\n|----------|------|----------|---------|-------------|\n| `--input_image` | str | Yes | - | Path to input image |\n| `--output_dir` | str | No | `./output` | Output directory path |\n| `--model_path` | str | No | `./models/u2net.pth` | Path to the pre-trained model weights |\n| `--debug` | flag | No | False | Enable debug mode |\n| `--save_results` | flag | No | False | Save intermediate images, labelme and config file |\n\n## Development\n\n### Setting up Development Environment\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/tuke307/tree-disk-segmentation.git\ncd tree-disk-segmentation\n```\n\n2. Create and activate virtual environment:\n```bash\npoetry install\npoetry shell\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A package for tree disk segmentation in images",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/tuke307/tree-disk-segmentation",
"Repository": "https://github.com/tuke307/tree-disk-segmentation"
},
"split_keywords": [
"tree",
" segmentation",
" image processing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "68cd4973d5077616c085c642b07bce4bb8f3c41d1bd430e0041a146be9da2dcd",
"md5": "64c5fc2339389878cd2af87ee6c08a58",
"sha256": "52f55caf1d5a7f2101e64dc10d54ec1c4bbe79bf5790d414908cf4f2a80c1e87"
},
"downloads": -1,
"filename": "tree_disk_segmentation-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "64c5fc2339389878cd2af87ee6c08a58",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 11209,
"upload_time": "2024-11-10T11:58:22",
"upload_time_iso_8601": "2024-11-10T11:58:22.619742Z",
"url": "https://files.pythonhosted.org/packages/68/cd/4973d5077616c085c642b07bce4bb8f3c41d1bd430e0041a146be9da2dcd/tree_disk_segmentation-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a2c42dbbf2d27275e28217c8a0a64ff8b7036bc3b6094d89fe9bf5336a98634b",
"md5": "d262c4c8cc0da33fef9883654388e44c",
"sha256": "36b3e73e4fff5e76c093bf8356f1c11572f35406f66ae6d4c07814db90d01c19"
},
"downloads": -1,
"filename": "tree_disk_segmentation-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "d262c4c8cc0da33fef9883654388e44c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 8901,
"upload_time": "2024-11-10T11:58:23",
"upload_time_iso_8601": "2024-11-10T11:58:23.747580Z",
"url": "https://files.pythonhosted.org/packages/a2/c4/2dbbf2d27275e28217c8a0a64ff8b7036bc3b6094d89fe9bf5336a98634b/tree_disk_segmentation-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-10 11:58:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tuke307",
"github_project": "tree-disk-segmentation",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tree-disk-segmentation"
}