98 double rs, rd, f, scale;
416 else if(
theta == 0.0 )
586 double c= 2.0*
atan(p/2.0);
812 double p = ((-1.0/3.0) * (a[2]/a[3]) * (a[2]/a[3]) + a[1]/a[3]) / 3.0;
813 double q = ((2.0/27.0) * (a[2]/a[3]) * (a[2]/a[3]) * (a[2]/a[3]) - (1.0/3.0) * (a[2]/a[3]) * (a[1]/a[3]) + a[0]/a[3]) / 2.0;
815 if(
q*
q + p*p*p >= 0.0 ){
833 *
n = 1;
root[0] = 0.0;
838 *
n = 1;
root[0] = - a[0] / a[1];
841 if( 4.0 * a[2] * a[0] > a[1] * a[1] ){
845 root[0] = (- a[1] +
sqrt( a[1] * a[1] - 4.0 * a[2] * a[0] )) / (2.0 * a[2]);
846 root[1] = (- a[1] -
sqrt( a[1] * a[1] - 4.0 * a[2] * a[0] )) / (2.0 * a[2]);
856 return pow(x, 1.0/3.0);
858 return - pow(-x, 1.0/3.0);
924 my.SetRotationY( b );
925 mz.SetRotationZ( c );
928 return ( (
mz *
mx) *
my );
930 return ( (
mx *
mz) *
my );
946 vigra::Rect2D boundingBox;
948 if (
src.getCorrectTCA()) {
960 return 1/std::max(
sx,
sy);
999 r = (-b +
sqrt(b * b - 3 * a * c)) / (3 * a);
1000 if (r >= 1 && r <=
r_test[0])
1005 r = (-b -
sqrt(b * b - 3 * a * c)) / (3 * a);
1006 if (r >= 1 && r <=
r_test[0])
1017 if (a == 0.0 && b != 0.0)
1020 if (r >= 1 && r <=
r_test[0])
1033 double scale =
d + r * (c + r * (b + r * a));
1061 for (
int i=0;
i < 4;
i++) {
1089 if (
src.getRadialDistortionCenterShift().x != 0.0) {
1094 if (
src.getRadialDistortionCenterShift().y != 0.0) {
1099 for (
int i=0;
i < 4;
i++) {
1102 mprad[3-
i] =
src.getRadialDistortionRed()[
i];
1105 mprad[3-
i] =
src.getRadialDistortionBlue()[
i];
1108 mprad[4] = (
src.getSize().x <
src.getSize().y ?
src.getSize().x:
src.getSize().y) / 2.0;
1119 for (
int i=0;
i < 4;
i++) {
1122 mprad[4] = (
src.getSize().x <
src.getSize().y ?
src.getSize().x:
src.getSize().y) / 2.0;
1148 for (
int i=0;
i < 4;
i++) {
1151 mprad[4] = (
src.getSize().x <
src.getSize().y ?
src.getSize().x:
src.getSize().y) / 2.0;
1164 for (
int i=0;
i < 4;
i++) {
1167 mprad[3-
i] =
src.getRadialDistortionRed()[
i];
1170 mprad[3-
i] =
src.getRadialDistortionBlue()[
i];
1173 mprad[4] = (
src.getSize().x <
src.getSize().y ?
src.getSize().x:
src.getSize().y) / 2.0;
1187 if (
src.getRadialDistortionCenterShift().y != 0.0) {
1190 if (
src.getRadialDistortionCenterShift().x != 0.0) {
1211 double imhfov = image.getHFOV();
1212 vigra::Size2D
srcSize = image.getSize();
1215 double imyaw = image.getYaw();
1216 double impitch = image.getPitch();
1217 double imroll = image.getRoll();
1218 double ima = image.getRadialDistortion()[0];
1219 double imb = image.getRadialDistortion()[1];
1220 double imc = image.getRadialDistortion()[2];
1221 double imd = image.getRadialDistortionCenterShift().x;
1222 double ime = image.getRadialDistortionCenterShift().y;
1223 double img = image.getShear().x;
1224 double imt = image.getShear().y;
1421 double imhfov = image.getHFOV();
1422 vigra::Size2D
srcSize = image.getSize();
1425 double imyaw = image.getYaw();
1426 double impitch = image.getPitch();
1427 double imroll = image.getRoll();
1428 double ima = image.getRadialDistortion()[0];
1429 double imb = image.getRadialDistortion()[1];
1430 double imc = image.getRadialDistortion()[2];
1431 double imd = image.getRadialDistortionCenterShift().x;
1432 double ime = image.getRadialDistortionCenterShift().y;
1609 vigra::Size2D(
dest.getWidth(),
dest.getHeight()),
1610 dest.getProjection(),
1618 vigra::Size2D(
dest.getWidth(),
dest.getHeight()),
1619 dest.getProjection(),
1633 vigra::Diff2D(
dest.getWidth(),
dest.getHeight()),
1634 dest.getProjection(),
dest.getHFOV() );
1649 vigra::Diff2D(
dest.getWidth(),
dest.getHeight()),
1650 dest.getProjection(),
dest.getHFOV() );
1666 src_image.setVar((*i).first, (*i).second.getValue());
1686 src_image.setVar((*i).first, (*i).second.getValue());
1696 std::vector<fDescription>::const_iterator
tI;
virtual const SrcPanoImage & getImage(std::size_t nr) const =0
get a panorama image, counting starts with 0
ProjectionFormat
Projection of final panorama.
All variables of a source image.
void setSize(vigra::Size2D val)
Set the image size in pixels.
general : Matrix3 is a class for handling 3x3 Matrix manipulation.
void SetRotationX(double a)
set the matrice to rotation around X
general : Vector3 is a class for handling 3D Vectors manipulation.
double x
x,y,z coordinates, 0 at the initialisation
#define PI
Header file for Khan's deghosting algorithm Copyright (C) 2009 Lukáš Jirkovský l.jirkovsky@gmail....
void stereographic_erect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
convert from erect to stereographic
void mercator_erect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
convert from erect to mercator
void sphere_tp_rect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
static void squareZero_copy(double *a, int *n, double *root)
void horiz(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void erect_stereographic(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
convert from stereographic to erect
void erect_mercator(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
convert from mercator to erect
static double cubeRoot_copy(double x)
void erect_transmercator(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
convert from erect to transverse mercator
void persp_rect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void radial(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void erect_sinusoidal(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
convert from sinusoidal to erect
static void radial_shift(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void erect_transpano(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
static void cubeZero_copy(double *a, int *n, double *root)
void erect_pano(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
double estRadialScaleCrop(const std::vector< double > &coeff, int width, int height)
Calculate effective scaling factor.
void erect_sphere_tp(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void inv_radial(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void rotate_erect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
double estScaleFactorForFullFrame(const SrcPanoImage &src)
Calculate effective scaling factor for a given source image.
void traceImageOutline(vigra::Size2D sz, TRANSFORM &transf, vigra::Rect2D &inside, vigra::Rect2D &boundingBox)
Internal function to estimate the image scaling required to avoid black stripes at the image borders.
void pano_erect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void transmercator_erect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
convert from erect to transverse mercator
static double CalcCorrectionRadius_copy(double *coeff)
void transpano_erect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void sphere_tp_erect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void sinusoidal_erect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
convert from erect to sinusoidal
void(* trfn)(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
Transformation function type.
Matrix3 SetMatrix(double a, double b, double c, int cl)
static double smallestRoot_copy(double *p)
void vert(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void rect_erect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void persp_sphere(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void rect_sphere_tp(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void resize(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void sphere_tp_pano(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void pano_sphere_tp(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
void erect_rect(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
std::map< std::string, Variable > VariableMap
Parameters for transformation calls Can be just one double, two double, 4 double, a matrix,...
Function descriptor to be executed by exec_function.
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.