| 70 | pairwise_.push_back( potential ); |
| 71 | } |
| 72 | void DenseCRF2D::addPairwiseGaussian ( float sx, float sy, LabelCompatibility * function, KernelType kernel_type, NormalizationType normalization_type ) { |
| 73 | MatrixXf feature( 2, N_ ); |
| 74 | for( int j=0; j<H_; j++ ) |
| 75 | for( int i=0; i<W_; i++ ){ |
| 76 | feature(0,j*W_+i) = i / sx; |
| 77 | feature(1,j*W_+i) = j / sy; |
| 78 | } |
| 79 | addPairwiseEnergy( feature, function, kernel_type, normalization_type ); |
| 80 | } |
| 81 | void DenseCRF2D::addPairwiseBilateral ( float sx, float sy, float sr, float sg, float sb, const unsigned char* im, LabelCompatibility * function, KernelType kernel_type, NormalizationType normalization_type ) { |
| 82 | MatrixXf feature( 5, N_ ); |
| 83 | for( int j=0; j<H_; j++ ) |