2.15.9 cvPalette

Brief Information

Apply specified palette colors to a gray or binary image to set a single-channel image

Additional Information

Minimum Origin Version Required: 2022

Command Line Usage

1. fname$ =system.path.program$ + "Palettes\Rainbow.PAL"; cvPalette;

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Image img

Input/Ouput

ImageLayer

<active>
Specify the input image. It is also the destination of the output image.
Palette File fname

Input

string

fname$
Select a palette. Refer to this page for how to add and manage color palettes in Origin.
Undo undo

Input

int

1
Check this checkbox to support undo: 0 = false, 1 = true.

Description

This function changes a gray or binary image into pseudo color image. The gray levels of the original image are mapped to different colors according to the specified palette file. Undo is supported.

See also img.Palette$ in LabTalk.

Examples

Example 1. Use Rainbow palette to color-mapping gray image

  1. With a gray image active, run
    cvpalette -d;
    in the Command Window to open the dialog.
  2. In the dialog, select palette Rainbow.PAL from <Origin program folder>\Palettes\. Click OK.
Palette dia.png

Result is shown below.

The original image
The output image
Palette before.png
Palette After.png

Algorithm

The computation uses function from OpenCV Main API. Please refer to the OpenCV Main API Help file, Version 2.4.11.0 and read imgproc. Image Processing topic.

References

Kenneth R.Castleman.1996. Digital Image Processing. Prentice Hall, Upper Saddle River, NJ, USA.