# ImageParameter Object

The `ImageParameter` object is designed to configure and organize parameters for image processing stages, including convert color-to-grayscale, enhance grayscale, binarize image, detect text zones, and detect texture stages. You can configure detailed parameters for each stage.

## Example

```json
{
    "ImageParameterOptions": [
        {
            "Name": "ip_default",
            "BaseImageParameterName": "ip_base",
            "ApplicableStages": [
                {"Stage": "SST_INPUT_COLOR_IMAGE"},
                {"Stage": "SST_SCALE_IMAGE", "ImageScaleSetting": {}},
                {"Stage": "SST_CONVERT_TO_GRAYSCALE", "ColourConversionModes": []},
                {"Stage": "SST_TRANSFORM_GRAYSCALE", "GrayscaleTransformationModes": []},
                {"Stage": "SST_ENHANCE_GRAYSCALE", "GrayscaleEnhancementModes": []},
                {"Stage": "SST_BINARIZE_IMAGE", "BinarizationModes": []},
                {"Stage": "SST_DETECT_TEXTURE", "TextureDetectionModes": []},
                {"Stage": "SST_REMOVE_TEXTURE_FROM_GRAYSCALE"},
                {"Stage": "SST_BINARIZE_TEXTURE_REMOVED_GRAYSCALE"},
                {"Stage": "SST_FIND_CONTOURS"},
                {"Stage": "SST_DETECT_SHORTLINES", "ShortlineDetectionMode": {}},
                {"Stage": "SST_ASSEMBLE_LINES", "LineAssemblyMode": {}},
                {"Stage": "SST_DETECT_TEXT_ZONES", "TextDetectionMode": {}},
                {"Stage": "SST_REMOVE_TEXT_ZONES_FROM_BINARY", "IfEraseTextZone": 0}
            ]
        }
    ]
}
```

## Parameters

| Parameter Name | Type | Required/Optional | Description |
| -------------- | ---- | ----------------- | ----------- |
| [`Name`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/name.md) | String | Required | The unique identifier for this `ImageParameter` object. |
| [`BaseImageParameterName`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/base-image-parameter-name.md) | String | Optional | The name of another `ImageParameter` object to inherit settings from. |
| [`ApplicableStages`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/applicable-stages.md) | Array | Optional | An array of stage objects defining the image processing pipeline. |

## Usage

Each functional product has default `ImageParameter` settings. You can either use the defaults or define custom `ImageParameter` objects for specific sections.

### Defining ImageParameter Objects

`ImageParameter` objects are configured under `ImageParameterOptions`, each with a unique name:

```json
{
    "ImageParameterOptions": [
        {
            "Name": "IP_0"
        },
        {
            "Name": "IP_1"
        }
    ]
}
```

You can create a new `ImageParameter` based on an existing one using inheritance:

```json
{
    "ImageParameterOptions": [
        {
            "Name": "IP_0"
        },
        {
            "Name": "IP_1",
            "BaseImageParameterName": "IP_0"
        }
    ]
}
```

### Referencing in Task Settings

Reference `ImageParameter` objects in task settings by name:

```json
{
    "SectionArray": [
        {
            "Section": "ST_REGION_PREDETECTION",
            "ImageParameterName": "IP_0"
        },
        {
            "Section": "ST_BARCODE_LOCALIZATION",
            "ImageParameterName": "IP_1"
        },
        {
            "Section": "ST_BARCODE_DECODING",
            "ImageParameterName": "IP_2"
        }
    ]
}
```

## Available Stages

| Stage Name | Description |
| ---------- | ----------- |
| [`SST_INPUT_COLOR_IMAGE`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-input-color-image.md) | Represents the starting stage of each section, serving as a placeholder for the input color image. |
| [`SST_SCALE_IMAGE`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-scale-image.md) | Scales the image up or down. |
| [`SST_CONVERT_TO_GRAYSCALE`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-convert-to-grayscale.md) | Converts a color image to grayscale. |
| [`SST_TRANSFORM_GRAYSCALE`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-transform-grayscale.md) | Transforms the grayscale image (e.g., for inverted barcodes). |
| [`SST_ENHANCE_GRAYSCALE`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-enhance-grayscale.md) | Enhances grayscale image quality. |
| [`SST_BINARIZE_IMAGE`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-binarize-image.md) | Converts grayscale to binary image. |
| [`SST_DETECT_TEXTURE`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-detect-texture.md) | Detects texture patterns in the image. |
| [`SST_REMOVE_TEXTURE_FROM_GRAYSCALE`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-remove-texture-from-grayscale.md) | Removes texture from grayscale image. |
| [`SST_BINARIZE_TEXTURE_REMOVED_GRAYSCALE`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-binarize-texture-removed-grayscale.md) | Binarizes the texture-removed grayscale image. |
| [`SST_FIND_CONTOURS`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-find-contours.md) | Finds contours in the image. |
| [`SST_DETECT_SHORTLINES`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-detect-shortlines.md) | Detects short lines for document boundary detection. |
| [`SST_ASSEMBLE_LINES`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-assemble-lines.md) | Assembles detected lines. |
| [`SST_DETECT_TEXT_ZONES`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-detect-text-zones.md) | Detects text zones in the image. |
| [`SST_REMOVE_TEXT_ZONES_FROM_BINARY`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/stage-remove-text-zones-from-binary.md) | Removes text zones from binary image. |

## Stage Parameters

Each stage can have associated parameters for fine-tuning:

- **SST_SCALE_IMAGE**: [`ImageScaleSetting`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/image-scale-settings.md)
- **SST_CONVERT_TO_GRAYSCALE**: [`ColourConversionModes`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/colour-conversion-modes.md)
- **SST_TRANSFORM_GRAYSCALE**: [`GrayscaleTransformationModes`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/grayscale-transformation-modes.md)
- **SST_ENHANCE_GRAYSCALE**: [`GrayscaleEnhancementModes`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/grayscale-enhancement-modes.md)
- **SST_BINARIZE_IMAGE**: [`BinarizationModes`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/binarization-modes.md)
- **SST_DETECT_TEXTURE**: [`TextureDetectionModes`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/texture-detection-modes.md)
- **SST_DETECT_SHORTLINES**: [`ShortlineDetectionMode`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/shortline-detection-mode.md)
- **SST_ASSEMBLE_LINES**: [`LineAssemblyMode`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/line-assembly-mode.md)
- **SST_DETECT_TEXT_ZONES**: [`TextDetectionMode`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/text-detection-mode.md)
- **SST_REMOVE_TEXT_ZONES_FROM_BINARY**: [`IfEraseTextZone`](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/if-erase-text-zone.md)
