# Histogram On Curve

This function block analyzes pixel values along a specified curve in a grayscale or binary image. It defines the curve based on pixel intensity along the specified line and provides insights into the pixel distribution across that curve.

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

`Input Image (Binary Image)` This input accepts a binary or grayscale image that will be analyzed.

`Line Location (pixel)` Specifies the pixel position of the line where the analysis will be performed.

`Line Detection Threshold` A threshold to determine which pixel values are considered significant along the line.

`Pixel Value Threshold` A threshold that event filters or highlights specific pixel values along the detected curve.

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

`Output Image` The modified image that displays the analyzed curve and additional graphical elements.

`Plot Image` An image that visualizes the pixel values along the detected line.

`Curve Image` This output contains the region with the detected curve represented graphically.

`Line Angle` The angle of the detected line with respect to the image axes.

`Is Line Valid?` A boolean output indicating whether the detected line is valid based on the analysis.

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

`Relation` A dropdown control to select whether the analysis will be performed in the vertical or horizontal direction.

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

`Curve Detection` The block detects curves by analyzing pixel intensities and identifying significant peaks.

`Visualization` Provides visual outputs that show key measurements, detected curves, and plots of pixel values, aiding in analysis.

`Validity Check` The block assesses if the detected line is valid according to the defined criteria.

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

1. **Input Image**: Connect a binary or grayscale image to the `Input Image (Binary Image)`.
2. **Line Position**: Specify the location of the line using the `Line Location (pixel)` input.
3. **Set Thresholds**: Enter appropriate values for the `Line Detection Threshold` and the \`\`Pixel Value Threshold.
4. **Direction Selection**: Use the `Relation` dropdown to choose whether to check horizontally or vertically.
5. **Evaluate**: Run the block to conduct the analysis and obtain results including visual representations and validation status.

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

The function block processes the input image and returns visualizations and numerical outputs based on detected curves along specified lines.

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

<details>

<summary>Preprocessing the Input Image</summary>

Improve results by preprocessing the input image with the `Image Threshold` function block to enhance key pixel intensities.

</details>

<details>

<summary>Using Pixel Value Threshold Effectively</summary>

Examine different values for the `Pixel Value Threshold` to get the best detection outcome. Higher values may miss small peaks, while lower values may include noise.

</details>

<details>

<summary>Checking for Validity</summary>

After performing the analysis, check the `Is Line Valid?` output to ensure your detected line meets necessary conditions for accuracy.

</details>

<details>

<summary>Analyzing Multiple Locations</summary>

For complex images, analyze multiple line locations by running the block with different values to gather more insights.

</details>

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

<details>

<summary>Invalid Line Location</summary>

If there is an error regarding the line location, ensure that the specified line position does not exceed the boundaries of the image dimensions.

</details>

<details>

<summary>No Valid Line Detected</summary>

If the result indicates that the detected line is not valid, consider preprocessing the image and adjusting threshold values for better results.

</details>
