

#include "common.h"
#include <iostream>

// Declaration of the CUDA public functions:
// (they are defined in the .cu files)
extern void binarize_cuda(std::vector<float>& value, float threshold);

int main(int argc, char *argv[])
{
  if(argc!=3)
  {
    std::cout << "Usage: " << argv[0] << " <input> <output>" << std::endl;
    exit(1);
  }
  
  FloatImageGray img(argv[1]);

  
  /* filter 1: binarize the image */
  binarize_cuda(img.values(), 0.5);
  
  
  /* filter 2: convolution */
  
  // a low-pass filter to be used with apply_3x3filter_cuda*
  float filter[3][3]
    = {{0.05, 0.1, 0.05},
       {0.1,  0.4, 0.1},
       {0.05, 0.1, 0.05}};
       
  // Apply 100 times the above 3x3 filter
  // apply_3x3filter_cuda(img, filter, 100);
    
  img.save(argv[2]);
  
  return 0;
}

