Channel Insertion

1 개요

여러 이미지의 채널을 추출하여 하나의 이미지에 삽입하는 알고리즘입니다.

2 알고리즘 상세 설명

각 삽입 이미지에서 설정한 채널을 추출하여, 이를 하나의 소스 이미지의 각 색인에 배치하고 대상 이미지에 설정합니다. 설정한 삽입 이미지의 수와 소스 이미지의 채널 수 만큼 대상 이미지의 채널이 생성됩니다.

예시

3개의 4채널 삽입 이미지에 대해 각각 0, 2, 2채널이 선택하여 4 채널 소스 이미지의 0, 1, 2번 색인에 삽입하면 대상 이미지는 7 채널 이미지가 생성된다. \n\n


아래는 1채널 이미지 2장의 0번 채널을 1채널 이미지의 1번 색인에 삽입해 3채널 이미지로 생성하는 예시입니다.

Source Insertion 1
Source Insertion1
Insertion 2 Result
Insertion2 Result
Source Insertion 1 Insertion 2 Result
Source1 Source2 Source3 Result
Fig. Channel Insertion 동작 예시

3 예제

CChannelInsertion channelInsertion;

CFLImage fliSourceImage;
channelInsertion.SetSourceImage(fliSourceImage);

CFLImage fliDestinationImage;
channelInsertion.SetDestinationImage(fliDestinationImage);

CFLImage fliInsertionImage0;
CFLImage fliInsertionImage1;

CFLArray<CFLImage*> flaInsertionImages;
flaInsertionImages.PushBack(&fliInsertionImage0);
flaInsertionImages.PushBack(&fliInsertionImage1);

CFLArray<int64_t> flaChannels ;
flaChannels.PushBack((int64_t)EChannelSelection_Channel_0);
flaChannels.PushBack((int64_t)EChannelSelection_Channel_0);

CFLArray<int64_t> flaPositions ;
flaPositions.PushBack((int64_t)0);
flaPositions.PushBack((int64_t)0);

channelInsertion.SetInsertionImage(flaInsertionImages);
channelInsertion.SetInsertionChannel(flaChannels);
channelInsertion.SetInsertionPosition(flaPositions);

channelInsertion.Execute();

CChannelInsertion channelInsertion = new CChannelInsertion();

CFLImage fliSourceImage = new CFLImage();
channelInsertion.SetSourceImage(ref fliSourceImage);

CFLImage fliDestinationImage = new CFLImage();
channelInsertion.SetDestinationImage(ref fliDestinationImage);

CFLImage fliInsertionImage0 = new CFLImage();
CFLImage fliInsertionImage1 = new CFLImage();

List<CFLImage> listInsertionImages = new List<CFLImage>();
listInsertionImages.Add(fliInsertionImage0);
listInsertionImages.Add(fliInsertionImage1);

List<Int64> listChannels = new List<Int64>();
listChannels.Add((Int64)EChannelSelection.Channel_0);
listChannels.Add((Int64)EChannelSelection.Channel_0);

List<Int64> listPositions = new List<Int64>();
listPositions.Add((Int64)0);
listPositions.Add((Int64)0);

channelInsertion.SetInsertionImage(ref listInsertionImages);
channelInsertion.SetInsertionChannel(listChannels);
channelInsertion.SetInsertionPosition(listPositions);

channelInsertion.Execute();