예제 #1
0
int main(int argc, char* argv[]) {

	processCommandLine(argc, argv);
	//setParameters();

	load(input, pps);

	fvision::exitIf(pps.size() == 0, string("can not get point correspondences from the input file: ") + infilepath + " !");
	fvision::exitIf(pps.size() < 8, "at least 8 points should be input!");

	FundamentalMatrixCalculatorFactory::Configuration config;
	if (homographyBased) config.method = FundamentalMatrixCalculatorFactory::Configuration::HOMOGRAPHY_BASED;
	config.ransacDistanceThreshold = threshold;
	if (verbose) { cout<<"configuration: "<<endl<<config<<endl; }

	pfmc = FundamentalMatrixCalculatorFactory().create(config);

	CvMatWrapper fw = pfmc->compute(pps);
	const CvMat* F = fw.getMat();

	outputHelper.setDir(outputDir);
	outputHelper.setExtension("txt");

	if (verbose) { cout<<"F: "<<endl<<F<<endl; }

	if (f_filename != NULL) { outputHelper.save(f_filename, fw); }

	evaluateF(F, pps);

    return 0;
}
예제 #2
0
void Gl1_PotentialParticle::generateScalarField(const PotentialParticle& pp) {
	for(int i=0; i<sizeX; i++) {
		for(int j=0; j<sizeY; j++) {
			for(int k=0; k<sizeZ; k++) {
				scalarField[i][j][k] = evaluateF(pp,  min[0]+ Real(i)*isoStep[0],  min[1]+ Real(j)*isoStep[1],  min[2]+Real(k)*isoStep[2]);//
			}
		}
	}
}
예제 #3
0
void Gl1_PotentialBlock::generateScalarField(const PotentialBlock& pp)
{
	

	for(int i=0;i<sizeX;i++){
		for(int j=0;j<sizeY;j++){
			for(int k=0;k<sizeZ;k++){
				scalarField[i][j][k] = evaluateF(pp,  min[0]+ double(i)*isoStep[0],  min[1]+ double(j)*isoStep[1],  min[2]+double(k)*isoStep[2]);//  
			}
		}
	}
}
예제 #4
0
파일: problem.fv.c 프로젝트: hpgmg/hpgmg
//------------------------------------------------------------------------------------------------------------------------------
void initialize_problem(level_type * level, double hLevel, double a, double b){
  level->h = hLevel;

  int box;
  for(box=0;box<level->num_my_boxes;box++){
    int i,j,k;
    const int jStride = level->my_boxes[box].jStride;
    const int kStride = level->my_boxes[box].kStride;
    const int  ghosts = level->my_boxes[box].ghosts;
    const int   dim_i = level->my_boxes[box].dim;
    const int   dim_j = level->my_boxes[box].dim;
    const int   dim_k = level->my_boxes[box].dim;
    #ifdef _OPENMP
    #pragma omp parallel for private(k,j,i) collapse(3)
    #endif
    for(k=0;k<=dim_k;k++){ // include high face
    for(j=0;j<=dim_j;j++){ // include high face
    for(i=0;i<=dim_i;i++){ // include high face
      //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      int ijk = (i+ghosts) + (j+ghosts)*jStride + (k+ghosts)*kStride;
      double x = hLevel*( (double)(i+level->my_boxes[box].low.i) + 0.5 ); // +0.5 to get to the center of cell
      double y = hLevel*( (double)(j+level->my_boxes[box].low.j) + 0.5 );
      double z = hLevel*( (double)(k+level->my_boxes[box].low.k) + 0.5 );
      double A,Bi,Bj,Bk;
      //double A,B,Bx,By,Bz,Bi,Bj,Bk;
      //double U,Ux,Uy,Uz,Uxx,Uyy,Uzz;
      //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      A  = 1.0;
      Bi = 1.0;
      Bj = 1.0;
      Bk = 1.0;
      #ifdef STENCIL_VARIABLE_COEFFICIENT // variable coefficient problem...
      Bi=evaluateBeta(x-hLevel*0.5,y           ,z           ,hLevel,0,1,1); // face-centered value of Beta for beta_i
      Bj=evaluateBeta(x           ,y-hLevel*0.5,z           ,hLevel,1,0,1); // face-centered value of Beta for beta_j
      Bk=evaluateBeta(x           ,y           ,z-hLevel*0.5,hLevel,1,1,0); // face-centered value of Beta for beta_k
      #endif
      //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      double F=evaluateF(x,y,z,hLevel,1,1,1);
      //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      #ifdef VECTOR_ALPHA
      level->my_boxes[box].vectors[VECTOR_ALPHA ][ijk] = A;
      #endif
      level->my_boxes[box].vectors[VECTOR_BETA_I][ijk] = Bi;
      level->my_boxes[box].vectors[VECTOR_BETA_J][ijk] = Bj;
      level->my_boxes[box].vectors[VECTOR_BETA_K][ijk] = Bk;
      level->my_boxes[box].vectors[VECTOR_F     ][ijk] = F;
      //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    }}}
  }

}