49 lines
859 B
C++
49 lines
859 B
C++
#ifndef DEBIAS
|
|
#define DEBIAS
|
|
|
|
#include <iostream>
|
|
#include <armadillo>
|
|
#include <fstream>
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
using namespace std;
|
|
using namespace arma;
|
|
|
|
|
|
class Debias
|
|
{
|
|
private:
|
|
|
|
const int D; // 多项式阶数
|
|
const double dsfact; // 下采样系数
|
|
const double beta; // 超参数
|
|
|
|
const int width;
|
|
const int height;
|
|
const int kernalSize; //中值滤波范围
|
|
dmat im_data; // 待处理数据
|
|
public:
|
|
|
|
Debias(int D, double dsfact, double beta, int width, int height, int kernalSize, dmat im_data) : D(D), dsfact(dsfact), beta(beta), width(width), height(height), kernalSize(kernalSize), im_data(im_data)
|
|
{
|
|
|
|
}
|
|
|
|
dmat gradient_width(); //求横向梯度
|
|
|
|
dmat gradient_height(); // 求纵向梯度
|
|
|
|
dmat biPoly_getC();
|
|
|
|
dmat biPoly_getW();
|
|
|
|
dmat getNeighborhood(dmat matric, int row, int col);
|
|
|
|
dmat medianFilter(dmat matric);
|
|
|
|
dmat mainDebias();
|
|
|
|
};
|
|
|
|
#endif |