# Slice Image

This function block allows you to slice an input image into smaller sections based on specified horizontal and vertical proportions. This is useful for analyzing parts of an image separately or for processing images in more manageable segments.

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

`Image Any` The main image that you want to slice.

`Horizontal Percentage` The number of horizontal slices to create from the image.

`Vertical Percentage` The number of vertical slices to create from the image.

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

`Image Any` The reconstructed output image assembled from the sliced pieces.

`Sliced Images` This output consists of the individual image segments obtained from the slicing process.

`Sliced Coordinates` The coordinates corresponding to where each slice is located in the original image.

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

`Horizontal Percentage` A numeric input specifying how many segments the image should be divided into horizontally. Default is `1`.

`Vertical Percentage` A numeric input specifying how many segments the image should be divided into vertically. Default is `1`.

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

`Flexible Slicing` You can define the number of horizontal and vertical slices independently to get the desired segmentations.

`Structured Output` The block returns both the sliced image segments and their coordinates, making it easy to link with other processing functions.

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

1. **Input an Image**: Connect the image you want to slice to the `Image Any` input.
2. **Set Slices**: Determine how many horizontal and vertical segments you want from the image by specifying values in the `Horizontal Percentage` and `Vertical Percentage` inputs.
3. **Evaluate the Block**: Execute the function block to perform the slicing. The output will include the reconstructed main image and the individual sliced segments.

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

When executed, this function block will process the input image according to the specified slice parameters, returning the sliced images and their coordinates for further processing.

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

<details>

<summary>Efficiency with Large Images</summary>

For larger images, consider slicing them into smaller sections to allow for more efficient processing and analysis. Use meaningful horizontal and vertical slice values for your specific analysis.

</details>

<details>

<summary>Verify Slice Values</summary>

Make sure that the slice values are greater than zero. Using slices of one or more will yield useful segments; slice values of zero may cause the block to fail.

</details>

<details>

<summary>Combining with Other Blocks</summary>

You can connect this block's output to other processing blocks like `Image Color Match`, `Object Detection`, or `OCR` to analyze sections of your images more effectively.

</details>

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

<details>

<summary>No Output Generated</summary>

If no output is generated, ensure that you have provided valid input images and set reasonable slice values in `Horizontal Percentage` and `Vertical Percentage`.

</details>

<details>

<summary>Invalid Slicing</summary>

If you encounter errors related to slicing invalid images, double-check the dimensions of your input image to ensure it can correctly support the number of slices specified.

</details>
