Documentation
Table of contents

ColourConversionModes

Parameter ColourConversionModes is a parameter for setting the mode for converting a colour image to a grayscale image. It consists of one or more ColourConversionMode items and each item has its own arguments.

Example

{
    "ColourConversionModes": [
        {
            "Mode": "CICM_GENERAL"
        }
    ]
}

Parameter Summary

Parameter ColourConversionModes consist of a group of colour conversion mode objects. Each colour conversion mode object includes a candidate mode and a series of mode arguments. The mode arguments of the colour conversion mode object is shown as follow:

Mode Arguments

Mode Argument Name Mode Argument Summary
Mode
(Required)
Description
Any one in Candidate Mode List as string
Type
String
Candidate Mode List
CICM_HSV
CICM_GENERAL
CICM_SKIP
Default Value
CICM_GENERAL
BlueChannelWeight
(Optional)
Description
Sets the weight value of Blue Colour Channel used for converting a colour image to a grayscale image.
Type
int
Range
[-1,1000]
Default Value
-1
Valid For
CICM_GENERAL
GreenChannelWeight
(Optional)
Description
Sets the weight value of Green Colour Channel used for converting a colour image to a grayscale image.
Type
int
Range
[-1,1000]
Default Value
-1
Valid For
CICM_GENERAL
RedChannelWeight
(Optional)
Description
Sets the weight value of Red Colour Channel used for converting a colour image to a grayscale image.
Type
int
Range
[-1,1000]
Default Value
-1
Valid For
CICM_GENERAL
ReferChannel
(Optional)
Description
Sets reference channel used for converting a colour image to a grayscale image by HSV algorithm.
Type
string
Range
"H_CHANNEL","S_CHANNEL","V_CHANNEL"
Default Value
"H_CHANNEL"
Valid For
CICM_HSV
LibraryFileName
(Optional)
Description
Sets the file name of the library to load dynamically.
Type
String
Range
A string value representing file name.
Default Value
""
Valid For
All modes.
LibraryParameters
(Optional)
Description
The library must be in the same place with Dynamsoft Barcode Reader Library.
Type
String
Range
A string value representing parameters.
Default Value
""
Valid For
All modes.

Default Setting

If the ColourConversionModes is not configured in your template file, the following settings will be used as the default settings.

{
    "ColourConversionModes" : 
    [
        {
            "BlueChannelWeight" : -1,
            "GreenChannelWeight" : -1,
            "Mode" : "CICM_GENERAL",
            "RedChannelWeight" : -1,
            "ReferChannel" : "H_CHANNEL"
        }
    ]
}

Candidate Modes Introduction

CICM_GENERAL

Converts a colour image to a grayscale image using the general RGB colour model.

Available Mode Arguments:

  • RedChannelWeight
  • BlueChannelWeight
  • GreenChannelWeight
  • LibraryFileName
  • LibraryParameters

CICM_HSV

Converts a colour image to a grayscale image using the HSV colour model.

Available Mode Arguments:

  • ReferChannel
  • LibraryFileName
  • LibraryParameters

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version
    • Version 2.x
      • Version 2.2.20
      • Version 2.2.10
      • Version 2.2.0
      • Version 2.0.30
      • Version 2.0.20
      • Version 2.0.10
      • Version 2.0.0
    Change +
    © 2003–2024 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support