<commit_before>// __BEGIN_LICENSE__
// Copyright (C) 2006, 2007 United States Government as represented by
// the Administrator of the National Aeronautics and Space Administration.
// All Rights Reserved.
// __END_LICENSE__


#ifdef _MSC_VER
#pragma warning(disable:4244)
#pragma warning(disable:4267)
#pragma warning(disable:4996)
#endif

#include <string>
#include <fstream>
#include <vector>
#include <sys/types.h>
#include <sys/stat.h>

#include <boost/program_options.hpp>
namespace po = boost::program_options;

#include <vw/Core.h>
#include <vw/Image.h>
#include <vw/FileIO.h>
#include <vw/Cartography.h>
#include <vw/Math.h>
#include <vw/Photometry.h>

using namespace vw;
using namespace vw::math;
using namespace vw::cartography;
using namespace vw::photometry;

std::vector<int> makeOverlapList(std::vector<int> inputIndices, int currIndex,
                                 int maxNumPrevIndices, int maxNumNextIndices) {
  int i, numPrevIndices, numNextIndices;

  //determine the number of previous overlapping files
  if (currIndex == 0) {
    numPrevIndices = 0;
  }
  else{
    int tempNumPrevIndices = currIndex - maxNumPrevIndices;
    printf("tempNumPrevFiles = %d\n", tempNumPrevIndices);
    if (tempNumPrevIndices < 0){
      numPrevIndices = currIndex;
    }
    else{
      numPrevIndices = maxNumPrevIndices;
    }
  }

  //determine the number of next overlapping files
  int temp = inputIndices.size() - (currIndex+1);
  if (temp < maxNumPrevIndices){
      numNextIndices = temp;
  }
  else{
      numNextIndices = maxNumNextIndices;
  }

  printf("curr index = %d\n", currIndex);
  printf("numPrevIndices = %d, numNextIndices = %d\n", numPrevIndices, numNextIndices);

  std::vector<int> overlapIndices(numPrevIndices+numNextIndices);
  int tmpIndex = 0;
  for (i = currIndex - numPrevIndices; i < currIndex; i++){
    overlapIndices[tmpIndex] = inputIndices[i];
    printf("%d %d\n", tmpIndex, overlapIndices[i - (currIndex - numPrevIndices)]);
    tmpIndex++;
  }
  for (i = currIndex+1; i <= currIndex + numNextIndices; i++){
    overlapIndices[tmpIndex] = inputIndices[i];
    printf("%d %d\n", tmpIndex, overlapIndices[tmpIndex]);
    tmpIndex++;
  }

  printf("-------------------------------------------\n");

  return overlapIndices;
}

int main( int argc, char *argv[] ) {

  std::vector<std::string> input_files;
  //int num_matches;
  std::string homeDir;
  std::string dataDir = "/data/orbit33";
  std::string resDir = "/results/orbit33";

  po::options_description general_options("Options");
  general_options.add_options()
    //("num-matches,m", po::value<int>(&num_matches)->default_value(1000), "Number of points to match for linear regression.")
    ("project-directory,d", po::value<std::string>(&homeDir)->default_value("../../../.."), "Base directory where data folders and result folders are.")
    ("help,h", "Display this help message");

  po::options_description hidden_options("");

  hidden_options.add_options()
    ("input-files", po::value<std::vector<std::string> >(&input_files));

  po::options_description options("Allowed Options");
  options.add(general_options).add(hidden_options);

  po::positional_options_description p;
  p.add("input-files", -1);

  std::ostringstream usage;
  usage << "Description: tonematches several images" << std::endl << std::endl;
  usage << general_options << std::endl;

  po::variables_map vm;
  try {
    po::store( po::command_line_parser( argc, argv ).options(options).positional(p).run(), vm );
    po::notify( vm );
  } catch ( po::error &e ) {
    std::cout << "An error occured while parsing command line arguments.\n";
    std::cout << "\t" << e.what() << "\n\n";
    std::cout << usage.str();
    return 1;
  }

  if( vm.count("help") ) {
    std::cerr << usage.str() << std::endl;
    return 1;
  }

  if( vm.count("input-files") < 1 ) {
    std::cerr << "Error: Must specify at least one input file!" << std::endl << std::endl;
    std::cerr << usage.str();
    return 1;
  }

  vw_out() << "Number of Files = " << input_files.size() << "\n";

  GlobalParams globalParams;
  //globalParams.reflectanceType = NO_REFL;
  globalParams.reflectanceType = LUNAR_LAMBERT;
  //globalParams.reflectanceType = LAMBERT;
  globalParams.slopeType = 1;
  globalParams.shadowThresh = 40;<commit_msg>changes to match the changes image moisaicing initialization<commit_after>// __BEGIN_LICENSE__
// Copyright (C) 2006, 2007 United States Government as represented by
// the Administrator of the National Aeronautics and Space Administration.
// All Rights Reserved.
// __END_LICENSE__


#ifdef _MSC_VER
#pragma warning(disable:4244)
#pragma warning(disable:4267)
#pragma warning(disable:4996)
#endif

#include <string>
#include <fstream>
#include <vector>
#include <sys/types.h>
#include <sys/stat.h>

#include <boost/program_options.hpp>
namespace po = boost::program_options;

#include <vw/Core.h>
#include <vw/Image.h>
#include <vw/FileIO.h>
#include <vw/Cartography.h>
#include <vw/Math.h>
#include <vw/Photometry.h>

using namespace vw;
using namespace vw::math;
using namespace vw::cartography;
using namespace vw::photometry;

std::vector<int> makeOverlapList(std::vector<int> inputIndices, int currIndex,
                                 int maxNumPrevIndices, int maxNumNextIndices) {
  int i, numPrevIndices, numNextIndices;

  //determine the number of previous overlapping files
  if (currIndex == 0) {
    numPrevIndices = 0;
  }
  else{
    int tempNumPrevIndices = currIndex - maxNumPrevIndices;
    printf("tempNumPrevFiles = %d\n", tempNumPrevIndices);
    if (tempNumPrevIndices < 0){
      numPrevIndices = currIndex;
    }
    else{
      numPrevIndices = maxNumPrevIndices;
    }
  }

  //determine the number of next overlapping files
  int temp = inputIndices.size() - (currIndex+1);
  if (temp < maxNumPrevIndices){
      numNextIndices = temp;
  }
  else{
      numNextIndices = maxNumNextIndices;
  }

  printf("curr index = %d\n", currIndex);
  printf("numPrevIndices = %d, numNextIndices = %d\n", numPrevIndices, numNextIndices);

  std::vector<int> overlapIndices(numPrevIndices+numNextIndices);
  int tmpIndex = 0;
  for (i = currIndex - numPrevIndices; i < currIndex; i++){
    overlapIndices[tmpIndex] = inputIndices[i];
    printf("%d %d\n", tmpIndex, overlapIndices[i - (currIndex - numPrevIndices)]);
    tmpIndex++;
  }
  for (i = currIndex+1; i <= currIndex + numNextIndices; i++){
    overlapIndices[tmpIndex] = inputIndices[i];
    printf("%d %d\n", tmpIndex, overlapIndices[tmpIndex]);
    tmpIndex++;
  }

  printf("-------------------------------------------\n");

  return overlapIndices;
}

int main( int argc, char *argv[] ) {

  std::vector<std::string> input_files;
  //int num_matches;
  std::string homeDir;
  std::string dataDir = "/data/orbit33";
  std::string resDir = "/results/orbit33";

  po::options_description general_options("Options");
  general_options.add_options()
    //("num-matches,m", po::value<int>(&num_matches)->default_value(1000), "Number of points to match for linear regression.")
    ("project-directory,d", po::value<std::string>(&homeDir)->default_value("../../../.."), "Base directory where data folders and result folders are.")
    ("help,h", "Display this help message");

  po::options_description hidden_options("");

  hidden_options.add_options()
    ("input-files", po::value<std::vector<std::string> >(&input_files));

  po::options_description options("Allowed Options");
  options.add(general_options).add(hidden_options);

  po::positional_options_description p;
  p.add("input-files", -1);

  std::ostringstream usage;
  usage << "Description: tonematches several images" << std::endl << std::endl;
  usage << general_options << std::endl;

  po::variables_map vm;
  try {
    po::store( po::command_line_parser( argc, argv ).options(options).positional(p).run(), vm );
    po::notify( vm );
  } catch ( po::error &e ) {
    std::cout << "An error occured while parsing command line arguments.\n";
    std::cout << "\t" << e.what() << "\n\n";
    std::cout << usage.str();
    return 1;
  }

  if( vm.count("help") ) {
    std::cerr << usage.str() << std::endl;
    return 1;
  }

  if( vm.count("input-files") < 1 ) {
    std::cerr << "Error: Must specify at least one input file!" << std::endl << std::endl;
    std::cerr << usage.str();
    return 1;
  }

  vw_out() << "Number of Files = " << input_files.size() << "\n";

  GlobalParams globalParams;
  globalParams.reflectanceType = NO_REFL;
  //globalParams.reflectanceType = LUNAR_LAMBERT;
  //globalParams.reflectanceType = LAMBERT;
  globalParams.slopeType = 1;
  globalParams.shadowThresh = 40;
{'fraction_non_alphanumeric': 0.1606295567642634, 'fraction_numerical': 0.009721097095243606, 'mean_word_length': 3.978110599078341, 'pattern_counts': {'":': 0, '<': 129, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6691790', 'n_tokens_mistral': 2868, 'n_tokens_neox': 2836, 'n_words': 662}