Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 5 commits
  • 7 files changed
  • 0 comments
  • 1 contributor
6 CMakeLists.txt
... ... @@ -1,6 +1,6 @@
1 1 cmake_minimum_required(VERSION 2.3)
2 2
3   -project( SIFT_Descriptor)
  3 +project( zoomout)
4 4 find_package (OpenCV REQUIRED)
5   -add_executable ( SIFT_Descriptor SIFT_Descriptor )
6   -target_link_libraries ( SIFT_Descriptor ${OpenCV_LIBS})
  5 +add_executable (SIFT_Descriptor SIFT_Descriptor.cpp zoomout.cpp)
  6 +target_link_libraries ( SIFT_Descriptor ${OpenCV_LIBS} )
10 README
@@ -23,9 +23,11 @@ CMake 2.8
23 23
24 24 BUILDIING FROM SOURCE:
25 25
26   -1. Go to the directory and run the following commands:
  26 +1. USE CMAKE
27 27
28   -cmake .
  28 +mkdir build
  29 +cd build
  30 +cmake ..
29 31 make
30 32
31 33 This should make the required files and the executable as well
@@ -33,7 +35,7 @@ This should make the required files and the executable as well
33 35
34 36 RUNNING THE CODE:
35 37
36   -./SIFT_descriptor <img1> <img2> <resize parameter in power of two> <threshold multiplier for min distance>
  38 +./SIFT_descriptor <Object image> <Scene Image> <resize parameter in power of two> <threshold multiplier for min distance>
37 39
38 40 img1 : Object Image (This will be the zoomed in version)
39 41 img2 : Scene Image (This will be the Map version, scaled out as compared to the object image)
@@ -47,4 +49,4 @@ Abhinav Gupta
47 49
48 50 CONSTRBUTORS:
49 51
50   -Ritesh Ranjan
  52 +Ritesh Ranjan
10 SIFT_Descriptor.cpp
@@ -11,6 +11,7 @@
11 11 #include "opencv2/calib3d/calib3d.hpp"
12 12 #include "opencv2/nonfree/features2d.hpp"
13 13 #include "opencv2/imgproc/imgproc.hpp"
  14 +#include "utils.hpp"
14 15
15 16 #define ASSERT(condition, message) \
16 17 if (! (condition)) { \
@@ -44,12 +45,7 @@ int main (int argc, char** argv)
44 45 return -1;
45 46 }
46 47
47   - for (int i =0; i< atoi(argv[3]); i++)
48   - {
49   - pyrDown(img_object_temp, img_object, Size( img_object_temp.cols/2, img_object_temp.rows/2)); // Scaling down the object image by a factor of 2^[argv[3]]
50   -
51   - img_object_temp = img_object;
52   - }
  48 + img_object = zoomout(img_object_temp, atoi(argv[3]));
53 49
54 50 std::vector<KeyPoint> keypoints_object, keypoints_scene; //Initializing data structures for keypoints & descriptors
55 51 Mat descriptors_object, descriptors_scene;
@@ -134,4 +130,4 @@ int main (int argc, char** argv)
134 130 * @function readme
135 131 */
136 132 void readme()
137   - { std::cout << " Usage: ./SIFT_descriptor <img1> <img2> <resize parameter in power of two> <threshold multiplier for min distance> \n FOR FURTHER INFO CHECK README \n" << std::endl; }
  133 + { std::cout << " Usage: ./SIFT_descriptor <object_image> <scene_image> <resize parameter in power of two> <threshold multiplier for min distance> \n FOR FURTHER INFO CHECK README \n" << std::endl; }
BIN  test-images/TEST.JPG
BIN  test-images/swiss.png
6 utils.hpp
... ... @@ -0,0 +1,6 @@
  1 +#ifndef UTILS_HPP
  2 +#define UTILS_HPP
  3 +
  4 +cv::Mat zoomout( cv::Mat src, int iterations );
  5 +
  6 +#endif
32 zoomout.cpp
... ... @@ -0,0 +1,32 @@
  1 +#include "opencv2/imgproc/imgproc.hpp"
  2 +#include "opencv2/highgui/highgui.hpp"
  3 +#include <math.h>
  4 +#include <stdlib.h>
  5 +#include <stdio.h>
  6 +
  7 +using namespace cv;
  8 +
  9 +/**
  10 + * @function main
  11 + */
  12 +Mat zoomout( Mat src, int iterations )
  13 +{
  14 +
  15 +
  16 +
  17 +
  18 + Mat dst = src;
  19 +
  20 +
  21 + for( int i = 0; i<iterations; i++)
  22 + {
  23 + pyrDown( src, dst, Size( src.cols/2, src.rows/2 ) );
  24 + src = dst;
  25 + }
  26 +
  27 +
  28 +
  29 +
  30 + return dst;
  31 +}
  32 +

No commit comments for this range

Something went wrong with that request. Please try again.