Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Commit

Permalink
Added the rolling shutter research for de-jittering code (#16)
Browse files Browse the repository at this point in the history
* Added the rolling shutter research for de-jittering code

* Removed sym links
  • Loading branch information
scsides authored and krlberry committed Jan 24, 2020
1 parent 6274b2e commit 4daf38b
Show file tree
Hide file tree
Showing 26 changed files with 1,574 additions and 0 deletions.
65 changes: 65 additions & 0 deletions rolling_shutter_jitter_devel/Cubic/Cubic.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* @file
* $Revision: 1.1.1.1 $
* $Date: 2006/10/31 23:18:08 $
*
* Unless noted otherwise, the portions of Isis written by the USGS are public
* domain. See individual third-party library and package descriptions for
* intellectual property information,user agreements, and related information.
*
* Although Isis has been used by the USGS, no warranty, expressed or implied,
* is made by the USGS as to the accuracy and functioning of such software
* and related material nor shall the fact of distribution constitute any such
* warranty, and no responsibility is assumed by the USGS in connection
* therewith.
*
* For additional information, launch
* $ISISROOT/doc//documents/Disclaimers/Disclaimers.html in a browser or see
* the Privacy & Disclaimers page on the Isis website,
* http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
* http://www.usgs.gov/privacy.html.
*/

#include <iostream>
#include <iomanip>
#include <sstream>
#include <math.h>
#include "FileName.h"
#include "Constants.h"
#include "IException.h"
#include "Cubic.h"

using namespace std;
namespace Isis {


/**
* This is the the overriding virtual function that provides the expansion into
* the parabolic equation.
* See BasisFunction for more information.
*
* @param vars A vector of double values to use for the expansion.
*/
void Cubic::Expand(const std::vector<double> &vars) {

if((int) vars.size() != Variables()) {
std::ostringstream msg;
msg << "Number of variables given (" << vars.size()
<< ") does not match expected (" << Variables() << ")!"
<< std::ends;
// std::cout << msg.str << std::endl;
// throw Isis::iException::Message("Isis::iException::Programmer",msg.str,
// _FILEINFO_);
}
double t1 = vars[0];
double t2 = vars[1];
p_terms.clear();
p_terms.push_back(pow(t1, 3) - pow(t2, 3));
p_terms.push_back(pow(t1, 2) - pow(t2, 2));
p_terms.push_back(t1 - t2);

// cout << std::setprecision(14) << t1 - t2 << "," << std::setprecision(14) << pow(t1, 2) - pow(t2, 2) << "," << std::setprecision(14) << pow(t1, 3) - pow(t2, 3) << endl;
return;
}
} // end namespace isis

68 changes: 68 additions & 0 deletions rolling_shutter_jitter_devel/Cubic/Cubic.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

#ifndef Cubic_h
#define Cubic_h
/**
* @file
* $Revision: 1.1.1.1 $
* $Date: 2006/10/31 23:18:08 $
*
* Unless noted otherwise, the portions of Isis written by the USGS are public
* domain. See individual third-party library and package descriptions for
* intellectual property information,user agreements, and related information.
*
* Although Isis has been used by the USGS, no warranty, expressed or implied,
* is made by the USGS as to the accuracy and functioning of such software
* and related material nor shall the fact of distribution constitute any such
* warranty, and no responsibility is assumed by the USGS in connection
* therewith.
*
* For additional information, launch
* $ISISROOT/doc//documents/Disclaimers/Disclaimers.html in a browser or see
* the Privacy &amp; Disclaimers page on the Isis website,
* http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
* http://www.usgs.gov/privacy.html.
*/

#include <vector>
#include "BasisFunction.h"

namespace Isis {

/**
* @brief Parabola basis function
*
* This is a derived class from the BasisFunction class which creates a parabola
* (second degree equation in 1 variable). The parabolic function has the
* following form:
*
* @f[
* x = A + B*y + C*y**2
* @f]
*
* @ingroup Math
*
* @author 2005-06-09 Kris Becker
*
* @internal
* @history 2006-04-15 Debbie A. Cook - Imported from ISIS2 to Isis 3
*/

class Cubic : public Isis::BasisFunction {
public:
//! Create a Parabola object

// Get help to figure out why I have to pass the name in even with the
// default set
Cubic(const QString &bname = "Cubic") :
Isis::BasisFunction(bname, 2, 3) { }

//! Destroys the Parabola object
~Cubic() {}

void Expand(const std::vector<double> &vars);

};

}
#endif

7 changes: 7 additions & 0 deletions rolling_shutter_jitter_devel/Cubic/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ifeq ($(ISISROOT), $(BLANK))
.SILENT:
error:
echo "Please set ISISROOT";
else
include $(ISISROOT)/make/isismake.objs
endif
73 changes: 73 additions & 0 deletions rolling_shutter_jitter_devel/HarmonicSolver/HarmonicSolver.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* @file
* $Revision: 1.5 $
* $Date: 2010/04/09 21:11:43 $
*
* Unless noted otherwise, the portions of Isis written by the USGS are
* public domain. See individual third-party library and package descriptions
* for intellectual property information, user agreements, and related
* information.
*
* Although Isis has been used by the USGS, no warranty, expressed or
* implied, is made by the USGS as to the accuracy and functioning of such
* software and related material nor shall the fact of distribution
* constitute any such warranty, and no responsibility is assumed by the
* USGS in connection therewith.
*
* For additional information, launch
* $ISISROOT/doc//documents/Disclaimers/Disclaimers.html
* in a browser or see the Privacy &amp; Disclaimers page on the Isis website,
* http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
* http://www.usgs.gov/privacy.html.
*/
#include <math.h>
#include <stdio.h>
#include <sstream>

#include <QPair>
#include <QString>

#include "Constants.h"
#include "CSVReader.h"
#include "HarmonicSolver.h"
#include "IException.h"

using namespace std;

namespace Isis {

HarmonicSolver::HarmonicSolver(const QString &file) {

m_file.read(file);

}

QPair <double, double> HarmonicSolver::solveXYJitter(const double time) {

//x is sample and y is line
double x_jitter = 0.0;
double y_jitter = 0.0;

for (int i = 0; i < m_file.rows(); i++) {
CSVReader::CSVAxis row = m_file.getRow(i);

double frequency = row[0].toDouble() * TWOPI;

double x_amp = row[1].toDouble();
double x_phase = row[2].toDouble();

double y_amp = row[3].toDouble();
double y_phase = row[4].toDouble();

double x_result = (x_amp * cos(frequency*time - x_phase));
double y_result = (y_amp * cos(frequency*time - y_phase));

x_jitter = x_jitter + x_result;
y_jitter = y_jitter + y_result;
}

return QPair <double, double>(x_jitter, y_jitter);

}

}
50 changes: 50 additions & 0 deletions rolling_shutter_jitter_devel/HarmonicSolver/HarmonicSolver.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#ifndef HarmonicSolver_h
#define HarmonicSolver_h
/**
* @file
* $Revision: 1.6 $
* $Date: 2010/04/09 21:11:43 $
*
* Unless noted otherwise, the portions of Isis written by the USGS are
* public domain. See individual third-party library and package descriptions
* for intellectual property information, user agreements, and related
* information.
*
* Although Isis has been used by the USGS, no warranty, expressed or
* implied, is made by the USGS as to the accuracy and functioning of such
* software and related material nor shall the fact of distribution
* constitute any such warranty, and no responsibility is assumed by the
* USGS in connection therewith.
*
* For additional information, launch
* $ISISROOT/doc//documents/Disclaimers/Disclaimers.html
* in a browser or see the Privacy &amp; Disclaimers page on the Isis website,
* http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
* http://www.usgs.gov/privacy.html.
*/

#include <QString>
#include <QPair>

#include "CSVReader.h"


namespace Isis {

class HarmonicSolver {

public:
HarmonicSolver(const QString &file);

QPair <double, double> solveXYJitter(const double time);


private:
CSVReader m_file;

};
}


#endif

7 changes: 7 additions & 0 deletions rolling_shutter_jitter_devel/HarmonicSolver/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ifeq ($(ISISROOT), $(BLANK))
.SILENT:
error:
echo "Please set ISISROOT";
else
include $(ISISROOT)/make/isismake.objs
endif
7 changes: 7 additions & 0 deletions rolling_shutter_jitter_devel/addjitter/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ifeq ($(ISISROOT), $(BLANK))
.SILENT:
error:
echo "Please set ISISROOT";
else
include $(ISISROOT)/make/isismake.apps
endif
Loading

0 comments on commit 4daf38b

Please sign in to comment.