示例#1
0
void Module_DLT::on_calibrate_button_clicked()
{
	if (this->getCounterPointsImage() == NUM_POINTSS){
		std::cout << "Clic calibrate: " << std::endl;
		this->solve_equation_system();

		drawKRTMatrix(this->K, this->R, this->X, k, r, x);
/*
		for (int i=0; i<9; i++)
		{
			std::cout << this->solution_matrix[i] << std::endl;

			std::stringstream labelString;
			labelString << solution_matrix[i];
			k[i]->set_label(labelString.str());
		}
*/
	}else{
		std::cout << "Tienes que selecionar todos los puntos" << std::endl;
	}

		std::cout << "Información invertida de la cámara" << std::endl;
		display_camerainfo(this->camera);

		/*Update camera with current values*/
		update_camera_matrix(&(this->camera));
		display_camerainfo(this->camera);

		reverse_update_camera_matrix(&(this->camera));
		display_camerainfo(this->camera);

}
/* gets the calibration of the camera from a file */
void myprogeo::load_cam(char *fich_in,int cam, int w, int h)
{
  //FILE *entrada;
  //int i;
	if (strlen(fich_in) ==0 ){
		std::cout << w << ", " << h << std::endl;
		this->cameras[cam].fdistx=515;
		this->cameras[cam].fdisty=515;
		this->cameras[cam].u0=h/2;
		this->cameras[cam].v0=w/2;
		this->cameras[cam].position.X=0;
		this->cameras[cam].position.Y=0;
		this->cameras[cam].position.Z=0;
		this->cameras[cam].foa.X=0;
		this->cameras[cam].foa.Y=1;
		this->cameras[cam].foa.Z=0;
		this->cameras[cam].skew=0;
		this->cameras[cam].roll=0;
		update_camera_matrix(&cameras[cam]);


	}
	else{
		xmlReader(&(this->cameras[cam]), fich_in);
		update_camera_matrix(&cameras[cam]);
	}

  display_camerainfo(cameras[cam]);
}