# Pose Estimation

This function block detects human body keypoints and (optionally) draws a skeleton on incoming images. Use it to extract selected body part positions for analytics, logging, or visualization.

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

`Image Any` The image to analyze (camera frame, loaded image, or preprocessed image).

`Show Skeleton` Boolean input to enable or disable drawing the skeleton on the output image.

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

`Image Any` The image with skeleton drawn (if `Show Skeleton` is enabled) and visual markers for detected keypoints.

`Selected Body Part Positions` A dictionary-like result mapping selected body part names to their detected positions (x, y). Only the body part groups you choose are returned.

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

`Class Names` A selectable list of simplified body-part groups (for example: head, chest, elbow, hand, hip, knee, foot). Check the groups you want the block to report.

`Confidence` A slider to adjust detection confidence. Increasing value reduces false positives but may miss faint detections; lowering it makes detection more permissive.

## ⚙️ Running mechanism <a href="#running-mechanism" id="running-mechanism"></a>

* When an image is provided at `Image Any`, the block analyzes the image and tries to locate human keypoints.
* If `Show Skeleton` is TRUE, the block overlays the skeleton lines and markers on the output image.
* The block returns the annotated image and a mapping of the selected body part names to their detected positions. If a part is not confidently detected it will be omitted from the mapping.

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

* Visual skeleton overlay for quick inspection.
* Selectable body-part groups to limit outputs to only the parts you need.
* Adjustable confidence control to balance sensitivity vs. false detections.
* Real-time friendly for live camera streams when paired with the appropriate image input block.

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

1. Provide an image source into `Image Any` (for example: `Camera USB`, `Load Image`, or `Stream Reader`).
2. Choose which body-part groups to output using `Class Names`.
3. Adjust detection sensitivity using the `Confidence` slider.
4. Optionally send a boolean into `Show Skeleton` to enable/disable skeleton drawing.
5. View the result image with `Show Image` or save/log positions for downstream use.

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

* Use `Camera USB` as a live image source when working with real-time scenes.
* Resize incoming images with `Image Resize` if the people appear too small — larger person pixels improve keypoint accuracy.
* Run a fast detector first (for example `Object Detection`) and then crop persons with `Image ROI` to feed individual person images to this block — this can increase reliability and lower processing cost.
* To preview results in your workspace, connect this block to `Show Image`.
* Save frames containing detections using `Image Logger` or export coordinates with `Data to JSON` or `CSV Export` for later analysis.
* Combine with `Draw Result On Image` or `Draw Detections` to annotate additional status text or bounding boxes together with skeletons.

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

* No keypoints detected: try lowering the `Confidence` value or increase input image size with `Image Resize`.
* False or jittery keypoints: increase the `Confidence` slider and improve lighting or sharpness (use `Blur` carefully only to remove noise).
* People partially out of frame: use an upstream detection/cropping workflow (for example `Object Detection` → `Image ROI`) so the subject is centered before running this block.
* Slow performance: reduce input resolution with `Image Resize` or process cropped person regions instead of full-frame images.

If you need to log or visualize results, use the suggested combinations under Tips and Tricks to build a robust pipeline.


---

# 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/ai-blocks/pose-estimation.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.
