Scaled Divide
1 개요
이미지 혹은 Scalar 값을 사용하여 Scaled Divide 연산을 수행하는 알고리즘입니다.
2 알고리즘 상세 설명
Scaled Divide의 연산은 다음 식을 활용합니다.
변수 MAX의 값은 a 변수의 최댓값을 뜻합니다.
Source Value | Operand Value | Destination Value |
---|---|---|
![]() |
![]() |
![]() |
Fig. Source, Operand and Destination values of Scaled Divide
a가 float 혹은 double인 경우 MAX를 1로 설정하여 일반적인 나누기 연산을 실행합니다.
Source Value | Operand Value | Destination Value |
---|---|---|
![]() |
![]() |
![]() |
Fig. Floating Source, Operand and Destination values of Scaled Divide
나누는 값이 0이고 a가 float/double이 아닌 경우 a가 양수이면 최대 값, a가 음수이면 최소 값, a가 0이면 0을 반환합니다.
Source Value | Operand Value | Destination Value |
---|---|---|
![]() |
![]() |
![]() |
Fig. Source, Zero Operand and Destination values of Scaled Divide
3 예제 코드
Scalar 연산
COperationScaledDivide operationScaledDivide;
CFLImage fliSourceImage;
CFLImage fliDestinationImage;
CMultiVar<double> mulVarScalar;
operationScaledDivide.SetSourceImage(fliSourceImage);
operationScaledDivide.SetDestinationImage(fliDestinationImage);
operationScaledDivide.SetOperationSource(EOperationSource_Scalar);
operationScaledDivide.SetScalarValue(mulVarScalar);
operationScaledDivide.Execute();
Image 연산
COperationScaledDivide operationScaledDivide;
CFLImage fliSourceImage;
CFLImage fliOperandImage;
CFLImage fliDestinationImage;
operationScaledDivide.SetSourceImage(fliSourceImage);
operationScaledDivide.SetOperandImage(fliOperandImage);
operationScaledDivide.SetDestinationImage(fliDestinationImage);
operationScaledDivide.SetOperationSource(EOperationSource_Image);
operationScaledDivide.Execute();