IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Append color channelsSee full documentation
imageappendColorChannelImg (inImg1,inImg2)

Detailed Description

Generates a color image by merging the color channel of the two input images.

This algorithm merges the channels of the two input images InImg1 and InImg2 in a unique image. By defining a pixel coordinate $x$, a channel index $c$ and the number of channels in the first input image $sizeC1$, the result is given by the formula:

\[ OutImg[x, c] = \begin{cases} InImg1[x, c], & \text{if }c < sizeC1 \\ InImg2[x, c-sizeC1], & \text{if } c \geq sizeC1\end{cases} \]

Here is an example of result:

appendColorChannelImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLColor as color

Code Example

# opening input images
inImg1 = PyIPSDK.loadTiffImageFile(inputImgPath1)
inImg2 = PyIPSDK.loadTiffImageFile(inputImgPath2)
# images addition
outImg = color.appendColorChannelImg(inImg1, inImg2)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLColor/Processor/AppendColorChannelImg/AppendColorChannelImg.h>

Code Example

// opening input image
ImagePtr pInImg1 = loadTiffImageFile(inputPath1);
ImagePtr pInImg2 = loadTiffImageFile(inputPath2);
// compute lightness on input image
ImagePtr pOutImg = appendColorChannelImg(pInImg1, pInImg2);