# Image Skeletonize

This function block extracts the skeletal structure of objects in a binary/grayscale image. It is useful for feature extraction, topology analysis, and producing thin representations of shapes for measurement or further processing.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

* `Image Gray` Grayscale or binary image to be skeletonized.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

* `Skeletonized` Full skeleton result as a binary image (thin, single-pixel-wide representation).
* `Skeletonized Lite` Thinned version using a standard thinning method.
* `Skeletonized Partially` Partially thinned image controlled by the iterations setting.

## 🕹️ Controls <a href="#controls" id="controls"></a>

* `Iterations` Slider to adjust maximum iteration for partial thinning. Higher values produce more thinning in the `Skeletonized Partially` output.

## 🎨 Features <a href="#features" id="features"></a>

* Produces three different skeleton-style outputs for flexible use in analysis and visualization.
* Works directly on binary or grayscale images—no coding required.
* `Skeletonized Partially` allows controlled thinning so you can balance detail vs. simplification.

## 📝 Usage Instructions <a href="#usage" id="usage"></a>

1. Prepare the image input and connect it to the `Image Gray` input socket.
2. If your image is not already binary (black & white), consider thresholding or preprocessing (see Tips and Tricks).
3. Adjust the `Iterations` slider to change how aggressive the partial thinning should be.
4. Use the outputs for visualization, shape analysis, or as inputs to other blocks.

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

When run, the block produces:

* `Skeletonized` for a full skeleton result,
* `Skeletonized Lite` for a standard thinned result,
* `Skeletonized Partially` which respects the `Iterations` control for gradual thinning.

These outputs can be inspected visually or fed to downstream blocks for measurement or further processing.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* Clean binary input produces the best skeletons. Consider using `Image Threshold` or `Image Adaptive Threshold` before this block to create a clear foreground/background separation.
* Reduce noise prior to skeletonization with `Blur` or `Denoising` to avoid spurious branches.
* Use `Morphological Transformations` (opening/closing) to remove small artifacts or to close small gaps in shapes before skeletonizing.
* Crop to the region of interest using `Image ROI Select` or `Image ROI` so the block focuses on the area you care about.
* After skeletonization, use `Find Contour`, `Approximate Contour`, or `Measure Position Distance` to extract measurements or further analyze the thin structures.
* If your images are large and processing is slow, try `Image Resizer` to reduce size before skeletonizing.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* No visible skeletons: Ensure the input is binary or has sufficient contrast. Try `Image Threshold` or increase contrast with `Contrast Optimization`.
* Too many small branches or noise: Apply `Morphological Transformations` or `Blur` before skeletonizing to remove small artifacts.
* Skeleton too thin or details lost: Lower the `Iterations` setting for a gentler partial thinning, or use the `Skeletonized Lite` output which preserves more structure.
* Processing is slow: Reduce input resolution with `Image Resizer` or preprocess to limit the area using `Image ROI Select`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/function-blocks/image-transformations/transformation-filters/image-skeletonize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
