Difference
1 개요
스칼라 또는 이미지와의 Difference 연산을 수행하는 알고리즘입니다. 이미지 픽셀값을 스칼라 또는 대응하는 이미지 픽셀값과의 절댓값 차이를 구하는 연산입니다.
2 알고리즘 상세 설명
Source |
Scalar Value : (100) |
Result |
 |
 |
Fig. Scalar 값에 따른 결과 비교
Fig. Image 값에 따른 결과 비교
Difference 알고리즘은 각 채널에 대해 Difference 연산을 수행합니다. 스칼라 연산과 이미지 연산을 지원합니다.
3 파라미터 설정 및 사용 방법
Source 픽셀의 각 채널에 대해 Scalar 연산을 수행할 Scalar 값을 설정합니다.
SetScalarValue(CMultiVar<double> mvScalarValue)
4 예제 코드
Scalar 연산
COperationDifference operationDifference;
CFLImage fliSourceImage;
CFLImage fliDestinationImage;
CMultiVar<double> mulVarScalar;
fliSourceImage.Load("../../ExampleImages/OperationDifference/siamesecat3ch.flif");
operationDifference.SetSourceImage(fliSourceImage);
operationDifference.SetDestinationImage(fliDestinationImage);
operationDifference.SetOperationSource(EOperationSource_Scalar);
operationDifference.SetScalarValue(mulVarScalar);
operationDifference.Execute();
COperationDifference operationDifference = new COperationDifference();
CFLImage fliSourceImage = new CFLImage();
CFLImage fliDestinationImage = new CFLImage();
CMultiVar<double> mulVarScalar = new CMultiVar<double>();
fliSourceImage.Load("../../ExampleImages/OperationDifference/siamesecat3ch.flif");
operationDifference.SetSourceImage(ref fliSourceImage);
operationDifference.SetDestinationImage(ref fliDestinationImage);
operationDifference.SetOperationSource(EOperationSource.Scalar);
operationDifference.SetScalarValue(mulVarScalar);
operationDifference.Execute();
operationDifference = COperationDifference()
fliSourceImage = CFLImage()
fliDestinationImage = CFLImage()
mulVarScalar = CMultiVar[Double]()
fliSourceImage.Load("../../ExampleImages/OperationDifference/siamesecat3ch.flif")
operationDifference.SetSourceImage(fliSourceImage)
operationDifference.SetDestinationImage(fliDestinationImage)
operationDifference.SetOperationSource(EOperationSource.Scalar)
operationDifference.SetScalarValue(mulVarScalar)
operationDifference.Execute()
Image 연산
COperationDifference operationDifference;
CFLImage fliSourceImage;
CFLImage fliOperandImage;
CFLImage fliDestinationImage;
fliSourceImage.Load("../../ExampleImages/OperationDifference/siamesecat3ch.flif");
fliOperandImage.Load("../../ExampleImages/OperationDifference/space3ch.flif");
operationDifference.SetSourceImage(fliSourceImage);
operationDifference.SetOperandImage(fliOperandImage);
operationDifference.SetDestinationImage(fliDestinationImage);
operationDifference.SetOperationSource(EOperationSource_Image);
operationDifference.Execute();
COperationDifference operationDifference = new COperationDifference();
CFLImage fliSourceImage = new CFLImage();
CFLImage fliOperandImage = new CFLImage();
CFLImage fliDestinationImage = new CFLImage();
fliSourceImage.Load("../../ExampleImages/OperationDifference/siamesecat3ch.flif");
fliOperandImage.Load("../../ExampleImages/OperationDifference/space3ch.flif");
operationDifference.SetSourceImage(ref fliSourceImage);
operationDifference.SetOperandImage(ref fliOperandImage);
operationDifference.SetDestinationImage(ref fliDestinationImage);
operationDifference.SetOperationSource(EOperationSource.Image);
operationDifference.Execute();
operationDifference = COperationDifference()
fliSourceImage = CFLImage()
fliOperandImage = CFLImage()
fliDestinationImage = CFLImage()
fliSourceImage.Load("../../ExampleImages/OperationDifference/siamesecat3ch.flif")
fliOperandImage.Load("../../ExampleImages/OperationDifference/space3ch.flif")
operationDifference.SetSourceImage(fliSourceImage)
operationDifference.SetOperandImage(fliOperandImage)
operationDifference.SetDestinationImage(fliDestinationImage)
operationDifference.SetOperationSource(EOperationSource.Image)
operationDifference.Execute()