Esempio n. 1
0
double intervalMSE(const SignalSource &signal1, const SignalSource &signal2, int step)
{
    qDebug() << "create interval MSE";
    auto aver1 = averagePowers(signal1, step, false);
    auto aver2 = averagePowers(signal2, step, false);
    return MSE(aver1, aver2);
}
Esempio n. 2
0
int main(int argc, char *argv[]){
	int * a;
	int * b;
	double t;
	const unsigned int N  = (argc >= 2) ? atoi(argv[1]) : 8;
	const unsigned int k1 = (argc >= 3) ? atoi(argv[2]) : 7;
	const unsigned int k2 = (argc >= 4) ? atoi(argv[3]) : 9;
	double resultado;
	t = tick();
	a = malloc(N*N*sizeof(int));
	b = malloc(N*N*sizeof(int));
	init_matrix(a, N, 0, k1);
	init_matrix(b, N, 1, k2);
	//a = read_ppm5("dos00064.pgm",&h, &w, &bbp);
	//b = read_ppm5("dos00065.pgm",&h, &w, &bbp);
	t = tick() - t;
	printf("Alocacion  y lectura de las matrices: %f\n", t);
	//b[0][0]=-22;
	t = tick();
	resultado = MSE(a,b,N);
	t = tick() - t;
	printf("Procesamiento MSE en matrices: %f\n", t);
	printf("\x1B[33mResultado final  =====>>>  %f\x1B[0m\n", resultado);
  	if (resultado == verificar (N, k1, k2))
    		printf("\x1B[32mVerificación: %f == %f\x1B[0m\n", resultado, verificar (N, k1, k2));
  	else
   		printf("\x1B[31mVerificación: %f == %f\x1B[0m\n", resultado, verificar (N, k1, k2));
	return 0;
}
Esempio n. 3
0
double PSNR(PPMImage *img,PPMImage *img2){
    double PSNR_;
    double MSE_;

    MSE_ = MSE(img,img2);

    MSE_ = 255 / sqrt(MSE_);

    PSNR_ = 20*log10(MSE_);

    return PSNR_;
}
Esempio n. 4
0
int main() {
  freopen("Lena.raw", "rb", stdin);
  int r, c;
  for (r = 0; r < N; r++)
    for (c = 0; c < N; c++)
      scanf("%c", &pic[r][c]);
  init();
  DCT();
  quantization();
  IDCT();
  MSE();
  return 0;
}
Esempio n. 5
0
CAPDU build_CA_Step_B(const OBJECT_IDENTIFIER_t& CA_OID, const unsigned char sessionid)
{
	MSE mse = MSE(MSE::P1_SET | MSE::P1_COMPUTE, MSE::P2_AT);
	// Build up command data field
	std::vector<unsigned char> oid(CA_OID.buf, CA_OID.buf+CA_OID.size);;
	std::vector<unsigned char> data = TLV_encode(0x80, oid);
	if (sessionid) {
		data.push_back(0xE0);
		data.push_back(0x03);
		data.push_back(0x81);
		data.push_back(0x01);
		data.push_back(sessionid);
	}
	mse.setData(data);

	return mse;
}
Esempio n. 6
0
int main(int argc, char* argv[])
{
	double x[] = {60, 65, 70, 65, 66, 68, 69, 62, 65, 66, 68, 59, 60, 64,
		66, 68, 59, 60, 64, 60, 64, 66, 68, 59, 60, 64, 59, 60, 64, 66, 69, 67};
	double y[32];

	int N = sizeof(x)/sizeof(double);
	int m = 4;

	for(int scale=1;scale<20;scale++)
	{
		int len_y = changeScale(x, y, N, scale);
		if(len_y <= m) break;
		for(int i=0;i<len_y;i++)
			printf("%f ", y[i]);
		double mse = MSE(y, len_y, m);
		printf("\n--------------------------------------------------------\n");
		printf("%f\n\n\n", mse);
	}

	return 0;
}
Esempio n. 7
0
/**
 * @brief RMSE computes the root mean squared error (RMSE) between two images.
 * @param ori is the original image.
 * @param cmp is the distorted image.
 * @param bLargeDifferences, if true, skips big differences for stability.
 * @param type is the domain where to compute RMSE (linear, logarithmic, and PU).
 * @return It returns the MSE value between ori and cmp.
 */
PIC_INLINE double RMSE(Image *ori, Image *cmp, bool bLargeDifferences = false, METRICS_DOMAIN type = MD_LIN)
{
    return sqrt(MSE(ori, cmp, bLargeDifferences, type));
}