/match.cpp

https://github.com/cherip/Harris · C++ · 30 lines · 22 code · 5 blank · 3 comment · 3 complexity · cc5c79c3eb09e974a817e6e39cb4e036 MD5 · raw file

  1. #include "harris.h"
  2. #include <cv.h>
  3. #include <highgui.h>
  4. #include <iostream>
  5. using namespace std;
  6. int main(int argc, char *argv[]) {
  7. if (argc <= 1) {
  8. cout << "need parameter!\n";
  9. return 1;
  10. }
  11. IplImage *img = cvLoadImage(argv[1]);
  12. IplImage *img2 = cvLoadImage(argv[2]);
  13. float threshold;
  14. if (argc == 3)
  15. threshold = atof(argv[2]);
  16. else
  17. threshold = 0.03;
  18. // IplImage *derivX = derivateX(img);
  19. // IplImage *derivY = derivateY(img);
  20. // IplImage *harr = harris(img, threshold);
  21. IplImage *ans1 = harris_laplace(img, 0.03);
  22. IplImage *ans2 = harris_laplace(img2, 0.03);
  23. IplImage *print = stack_imgs(ans1, ans2);
  24. show_image(print, "two");
  25. }