# Deconvolution

This function block helps restore sharpness and detail in images—especially useful for images of fast-moving objects that appear blurred. Use the provided sliders to tune the restoration effect for your camera and scene.

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

`Image Any` (input socket)\
A color or grayscale image to be processed.

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

`Image Any` (output socket)\
The processed image with deconvolution applied.

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

`Angle`\
Adjusts the direction or orientation of the deconvolution effect. Useful when motion blur has a predominant direction.

`Diameter`\
Controls the size/strength of the correction area. Higher values affect larger blur kernels.

`Noise Reduction`\
Controls how aggressively noise is reduced while restoring detail. Increasing this reduces noise but may soften fine detail.

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

* Restores sharpness for motion-blurred images while allowing user control over direction and strength.
* Works with both grayscale and color images (color images are processed per channel).
* Simple sliders make it easy to experiment without technical knowledge.

## ⚙️ Running mechanism <a href="#how-it-works" id="how-it-works"></a>

When the block runs it accepts the incoming image, applies the deconvolution processing (taking into account the chosen `Angle`, `Diameter`, and `Noise Reduction` values) and outputs the corrected image. If a color image is provided, each color channel is handled so the final output keeps correct color information.

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

1. Connect a camera or image source to the `Image Any` input.
2. Start with moderate values: set `Angle` to match the motion direction (if known), set `Diameter` to a small/medium value, and set `Noise Reduction` low.
3. Inspect the result and adjust sliders until the image looks sharp without excessive artifacts.
4. Use the output image downstream (display, save, measurement, etc.).

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

* Combine with `Denoising` before this block to reduce sensor noise and avoid amplifying noise during deconvolution.
* If the input image is very large, use `Image Resize` to lower the resolution for faster experimentation, then re-run at full size for final results.
* Use `Image ROI` to crop to the area of interest before processing—this speeds up tuning and prevents over-processing irrelevant areas.
* If contrast is low, try `Contrast Optimization` prior to deconvolution to make details more recoverable.
* Use `Show Image` to preview results quickly, and `Image Logger` to save processed frames for later review.

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

* Output looks noisy or has artifacts: increase `Noise Reduction` or place a `Denoising` block before deconvolution.
* No visible improvement: try changing `Angle` to match motion direction and increase `Diameter` gradually.
* Processing is slow: reduce image size with `Image Resize` or limit processing to a region with `Image ROI`.
* Colors look off after processing: confirm you started with a color image and preview using `Show Image`; if necessary, adjust the pipeline order (e.g., apply `Contrast Optimization` before deconvolution).


---

# 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/deconvolution.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.
