# Mean Value of Image

This function block computes the average pixel intensity of an incoming image and displays the result as a number between 0 and 255. It is useful for quick quality checks (brightness), preprocessing decisions, and simple monitoring.

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

* `Image Any` The image whose mean pixel value will be computed.

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

* `Mean Value` The calculated mean pixel intensity (rounded), range 0–255.

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

* `Mean value` A small on-block display that shows the current computed mean.\
  This block has no other user-editable controls.

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

* Fast computation of the average pixel intensity for any image type.
* Live visual feedback via the on-block display.
* Works with color or grayscale images by averaging all channels/pixels into a single scalar value.

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

1. Connect any image-producing block to the `Image Any` input.
2. Run the scenario. The block will compute the average intensity and update the `Mean value` display.
3. Read the numeric result from the `Mean Value` output for downstream logic or logging.

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

When executed, the block calculates the mean across all pixels (and channels) of the provided image and returns a numeric value (rounded) that represents overall brightness/average intensity.

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

* Use `Blur` before this block to reduce the effect of small noisy fluctuations on the mean.
* Use `Image Threshold` or `Apply Mask` to compute mean only over foreground regions instead of the entire image.
* Use `Image ROI` or `Image ROI Select` to restrict the calculation to a region of interest (for localized brightness checks).
* Reduce processing cost on large images by adding `Image Resizer` prior to this block.
* Use `Show Image` alongside this block to visually confirm which frame the mean value refers to.
* Combine with `Image Memory` to freeze a sample image and repeatedly analyze the same frame for stable comparisons.

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

* If the `Mean Value` is unexpected, verify the input image using `Show Image` to confirm correct source and content.
* If no value appears, ensure the image-producing block is actively providing valid image data. The block expects an image-type input.
* For inconsistent readings, try smoothing with `Blur` or cropping the area of interest with `Image ROI Select` before computing the mean.


---

# 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/analysis/mean-value-of-image.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.
