Scaled Subtract

1 개요

이미지 혹은 Scalar 값을 사용하여 Scaled Subtract 연산을 수행하는 알고리즘입니다.

2 알고리즘 상세 설명

Scaled Subtract의 연산은 다음 식을 활용합니다.

IDst(x,y)=(ISrc(x,y)+IOpr((x,y))2I_{Dst}(x,y) = \frac{(I_{Src}(x,y) + \overline{I_{Opr}((x,y))}}{2 }

Src와 Opr의 보수를 더한 값을 2로 나누는 연산을 수행하며, float, double 타입 이미지의 경우 아래의 식을 사용합니다.

IDst(x,y)=(ISrc(x,y)IOpr((x,y))2I_{Dst}(x,y) = \frac{(I_{Src}(x,y) - I_{Opr}((x,y))}{2 }

Source Image Operand Image Destination Image
Source Image Operation Image Destination Image
Fig. Source, Operand and Destination values of Scaled Subtract

3 예제 코드

Scalar 연산

COperationScaledSubtract scaledSubtract;

CFLImage fliSourceImage;
CFLImage fliDestinationImage;
CMultiVar<double> mulVarScalar;

scaledSubtract.SetSourceImage(fliSourceImage);
scaledSubtract.SetDestinationImage(fliDestinationImage);
scaledSubtract.SetOperationSource(EOperationSource_Scalar);
scaledSubtract.SetScalarValue(mulVarScalar);

scaledSubtract.Execute();
COperationScaledSubtract scaledSubtract = new COperationScaledSubtract();

CFLImage fliSourceImage = new CFLImage();
CFLImage fliDestinationImage = new CFLImage();
CMultiVar<double> mulVarScalar = new CMultiVar<double>();

scaledSubtract.SetSourceImage(ref fliSourceImage);
scaledSubtract.SetDestinationImage(ref fliDestinationImage);
scaledSubtract.SetOperationSource(EOperationSource.Scalar);
scaledSubtract.SetScalarValue(mulVarScalar);

scaledSubtract.Execute();

Image 연산

COperationScaledSubtract scaledSubtract;

CFLImage fliSourceImage;
CFLImage fliOperandImage;
CFLImage fliDestinationImage;

scaledSubtract.SetSourceImage(fliSourceImage);
scaledSubtract.SetOperandImage(fliOperandImage);
scaledSubtract.SetDestinationImage(fliDestinationImage);
scaledSubtract.SetOperationSource(EOperationSource_Image);

scaledSubtract.Execute();
COperationScaledSubtract scaledSubtract = new COperationScaledSubtract();

CFLImage fliSourceImage = new CFLImage();
CFLImage fliOperandImage = new CFLImage();
CFLImage fliDestinationImage = new CFLImage();

scaledSubtract.SetSourceImage(ref fliSourceImage);
scaledSubtract.SetOperandImage(ref fliOperandImage);
scaledSubtract.SetDestinationImage(ref fliDestinationImage);
scaledSubtract.SetOperationSource(EOperationSource.Image);

scaledSubtract.Execute();