Exemplo n.º 1
0
//----------------------------------------
int fdct3d_param(int N1, int N2, int N3, int nbscales, int nbdstz_coarse,
				  vector< vector<double> >& fxs, vector< vector<double> >& fys, vector< vector<double> >& fzs,
				  vector< vector<int   > >& nxs, vector< vector<int   > >& nys, vector< vector<int   > >& nzs)
{
  fxs.resize(nbscales);  fys.resize(nbscales);  fzs.resize(nbscales);
  nxs.resize(nbscales);  nys.resize(nbscales);  nzs.resize(nbscales);
  
  int L = nbscales;
  {
	 int s = 0;
	 double L1 = 4.0*N1/3.0 / pow2(L-1-s);	 double L2 = 4.0*N2/3.0 / pow2(L-1-s);	 double L3 = 4.0*N3/3.0 / pow2(L-1-s);
	 fdct3d_param_center(L1,L2,L3,s, fxs,fys,fzs, nxs,nys,nzs);
  }
  for(int s=1; s<L-1; s++) {
	 double L1 = 4.0*N1/3.0 / pow2(L-1-s);	 double L2 = 4.0*N2/3.0 / pow2(L-1-s);	 double L3 = 4.0*N3/3.0 / pow2(L-1-s);
	 int nd = nbdstz_coarse * pow2(s/2);
	 fdct3d_param_angles(L1,L2,L3,s, nd, fxs,fys,fzs, nxs,nys,nzs);
  }
  {
	 int s = L-1;
	 double L1 = 4.0*N1/3.0 / pow2(L-1-s);	 double L2 = 4.0*N2/3.0 / pow2(L-1-s);	 double L3 = 4.0*N3/3.0 / pow2(L-1-s);
	 fdct3d_param_wavelet(L1,L2,L3,s, N1,N2,N3, fxs,fys,fzs, nxs,nys,nzs);
  }
  
  return 0;
}
Exemplo n.º 2
0
//----------------------------------------
int fdct3d_param(int N1, int N2, int N3, int nbscales, int nbdstz_coarse, int ac,
				  vector< vector<float> >& fxs, vector< vector<float> >& fys, vector< vector<float> >& fzs,
				  vector< vector<int   > >& nxs, vector< vector<int   > >& nys, vector< vector<int   > >& nzs)
{
  fxs.resize(nbscales);  fys.resize(nbscales);  fzs.resize(nbscales);
  nxs.resize(nbscales);  nys.resize(nbscales);  nzs.resize(nbscales);
  
  int L = nbscales;

  if(ac==1) {
	 {
		int s = 0;
		float L1 = 4.0*N1/3.0 / pow2(L-1-s);	 float L2 = 4.0*N2/3.0 / pow2(L-1-s);	 float L3 = 4.0*N3/3.0 / pow2(L-1-s);
		fdct3d_param_center(L1,L2,L3,s, fxs,fys,fzs, nxs,nys,nzs);
	 }
	 for(int s=1; s<L; s++) {
		float L1 = 4.0*N1/3.0 / pow2(L-1-s);	 float L2 = 4.0*N2/3.0 / pow2(L-1-s);	 float L3 = 4.0*N3/3.0 / pow2(L-1-s);
		int nd = nbdstz_coarse * pow2(s/2);
		fdct3d_param_angles(L1,L2,L3,s, nd, fxs,fys,fzs, nxs,nys,nzs);
	 }
  } else {
	 {
		int s = 0;
		float L1 = 4.0*N1/3.0 / pow2(L-1-s);	 float L2 = 4.0*N2/3.0 / pow2(L-1-s);	 float L3 = 4.0*N3/3.0 / pow2(L-1-s);
		fdct3d_param_center(L1,L2,L3,s, fxs,fys,fzs, nxs,nys,nzs);
	 }
	 for(int s=1; s<L-1; s++) {
		float L1 = 4.0*N1/3.0 / pow2(L-1-s);	 float L2 = 4.0*N2/3.0 / pow2(L-1-s);	 float L3 = 4.0*N3/3.0 / pow2(L-1-s);
		int nd = nbdstz_coarse * pow2(s/2);

		// Define angles for 6 different faces of a cube ***************************************
		fdct3d_param_angles(L1,L2,L3,s, nd, fxs,fys,fzs, nxs,nys,nzs);
	 }
	 {
		int s = L-1;
		float L1 = 4.0*N1/3.0 / pow2(L-1-s);	 float L2 = 4.0*N2/3.0 / pow2(L-1-s);	 float L3 = 4.0*N3/3.0 / pow2(L-1-s);
		fdct3d_param_wavelet(L1,L2,L3,s, N1,N2,N3, fxs,fys,fzs, nxs,nys,nzs);
	 }
  }
  
  return 0;
}