Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions Descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,24 @@
* this code :)
******************************************************/

#pragma once
#ifndef DESCRIPTOR_H
#define DESCRIPTOR_H

#include<vector>
using namespace std;

class Descriptor
{
public:
float xi, yi; // The location
vector<double> fv; // The feature vector

Descriptor()
{
}
vector<float> fv; // The feature vector

Descriptor(float x, float y, vector<double> const& f)
Descriptor(float x, float y, vector<float> const& f)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using an initializer list here.

{
xi = x;
yi = y;
fv = f;
}
};

#endif
#endif
16 changes: 8 additions & 8 deletions KeyPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* this code :)
******************************************************/

#pragma once
#ifndef _KEYPOINT_H
#define _KEYPOINT_H

Expand All @@ -20,13 +21,12 @@ class Keypoint
public:
float xi;
float yi; // It's location
vector<double> mag; // The list of magnitudes at this point
vector<double> orien; // The list of orientations detected
unsigned int scale; // The scale where this was detected

Keypoint() { }
Keypoint(float x, float y) { xi=x; yi=y; }
Keypoint(float x, float y, vector<double> const& m, vector<double> const& o, unsigned int s)
vector<float> mag; // The list of magnitudes at this point
vector<float> orien; // The list of orientations detected
int scale; // The scale where this was detected

//defining the constructor
Keypoint(float x, float y, vector<float>m, vector<float>o, int s)
{
xi = x;
yi = y;
Expand All @@ -36,4 +36,4 @@ class Keypoint
}
};

#endif
#endif
26 changes: 9 additions & 17 deletions MySIFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,18 @@
// MySIFT.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
#include<opencv2/opencv.hpp>
#include "mySIFT.h"
using namespace cv;
using namespace std;

#include "SIFT.h"

#include <cv.h>
#include <highgui.h>

// The main function!
int main()
{
// Create an instance of SIFT
SIFT *sift = new SIFT("C:\\house.jpg", 4, 2);

sift->DoSift(); // Find keypoints
sift->ShowAbsSigma(); // Display the sigma table
sift->ShowKeypoints(); // Show the keypoints
cvWaitKey(0); // Wait for a keypress

// Cleanup and exit
delete sift;
Mat img = imread("car.jpg");
meSIFT x(img,4,2);
x.DoSift();
x.ShowKeypoints();
return 0;
}

Loading