ETRI IVCL 1.0.0
Acceleration SW Platform for Ondevice
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions | Variables
SIFT.hpp File Reference
#include "opencv2/imgproc.hpp"
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/xfeatures2d.hpp"
#include <vector>
#include <chrono>

Macros

#define SIFT_INTERVALS   3
 
#define SIFT_SIGMA   1.6f
 
#define SIFT_CONTRAST_THRES   0.03
 
#define SIFT_CURVATURE_THRES   10
 
#define SIFT_IMG_DBL   false
 
#define SIFT_DESCR_WIDTH   4
 
#define SIFT_DESCR_HIST_BINS   8
 
#define STATUS_BAR   true
 

Functions

void extractSiftFeatures (const Mat &img, vector< KeyPoint > &keypoints, Mat &descriptor, int intervals=SIFT_INTERVALS, double sigma=SIFT_SIGMA, double contrast_thres=SIFT_CONTRAST_THRES, int curvature_thres=SIFT_CURVATURE_THRES, bool img_dbl=SIFT_IMG_DBL, int descr_width=SIFT_DESCR_WIDTH, int descr_hist_bins=SIFT_DESCR_HIST_BINS)
 
void convertGrayAndNormalize (const Mat &input, Mat &output)
 
void resizeHalf (const Mat &input, Mat &output, Size outSize)
 
void filterCreation (double **GKernel, int kSize, double sigma)
 
void filterCreation1D (float *GKernel, int kSize, double sigma)
 
void gaussianBlur (const Mat &src, Mat &output, int kSize, double **kernel)
 
void start_time (system_clock::time_point &startTime)
 
void end_time (system_clock::time_point &startTime, system_clock::time_point &endTime, const char *step_name)
 
void statusBarUpdate (Mat &part, Mat &totalResult, int idx, int portion, bool is_left)
 

Variables

std::chrono::duration< double > global_elapsed_Time [4]
 
double ** gKernel
 
int kSize
 
Mat totalResult
 
Mat partM [6]
 
bool is_left
 

Macro Definition Documentation

◆ SIFT_CONTRAST_THRES

#define SIFT_CONTRAST_THRES   0.03

◆ SIFT_CURVATURE_THRES

#define SIFT_CURVATURE_THRES   10

◆ SIFT_DESCR_HIST_BINS

#define SIFT_DESCR_HIST_BINS   8

◆ SIFT_DESCR_WIDTH

#define SIFT_DESCR_WIDTH   4

◆ SIFT_IMG_DBL

#define SIFT_IMG_DBL   false

◆ SIFT_INTERVALS

#define SIFT_INTERVALS   3

DEFAULT SIFT PARAMS

◆ SIFT_SIGMA

#define SIFT_SIGMA   1.6f

◆ STATUS_BAR

#define STATUS_BAR   true

Function Documentation

◆ convertGrayAndNormalize()

void convertGrayAndNormalize ( const Mat &  input,
Mat &  output 
)

Change 3Channel RGB image to normalized gray image.

Parameters
input3Channel RGB input image
outputnormalized grayscale output image with pixel values in 0.0f~1.0f

◆ end_time()

void end_time ( system_clock::time_point &  startTime,
system_clock::time_point &  endTime,
const char *  step_name 
)

◆ extractSiftFeatures()

void extractSiftFeatures ( const Mat &  img,
vector< KeyPoint > &  keypoints,
Mat &  descriptor,
int  intervals = SIFT_INTERVALS,
double  sigma = SIFT_SIGMA,
double  contrast_thres = SIFT_CONTRAST_THRES,
int  curvature_thres = SIFT_CURVATURE_THRES,
bool  img_dbl = SIFT_IMG_DBL,
int  descr_width = SIFT_DESCR_WIDTH,
int  descr_hist_bins = SIFT_DESCR_HIST_BINS 
)

[Detect & extract sift features for an image]

Parameters
img[source image for extract sift features : grayscale image with pixel values in 0.0f~1.0f]
keypoints[vector for store sift feature point]
descriptor[Mat for store sift descriptor, each row for a keypoint]
intervals[the number of sampled intervals per octave]
sigma[sigma for initial gaussian smoothing]
contrast_thres[threshold on keypoint contrast]
curvature_thres[threshold on keypoint ratio of principle curvatures]
img_dbl[double image size before pyramid construction?]
descr_width[width of descriptor histogram array]
descr_hist_bins[number of bins per histogram in descriptor array]

◆ filterCreation()

void filterCreation ( double **  GKernel,
int  kSize,
double  sigma 
)

Create 2D gaussian filter

Parameters
GKerneloutput 2D gaussian filter
kSizegaussian kernel size
sigmagaussian sigma

◆ filterCreation1D()

void filterCreation1D ( float *  GKernel,
int  kSize,
double  sigma 
)

Create 1D gaussian filter

Parameters
GKerneloutput 1D gaussian filter
kSizegaussian kernel size
sigmagaussian sigma

◆ gaussianBlur()

void gaussianBlur ( const Mat &  src,
Mat &  output,
int  kSize,
double **  kernel 
)

Blurs an image using a Gaussian filter using padding
Assume that dst already copy the data of src

Parameters
srcinput image; Normalized grayscale input image
outputoutput image of the same size and type as src.
kSizewidth of the input image
kernelGaussian 2D kernel

◆ resizeHalf()

void resizeHalf ( const Mat &  input,
Mat &  output,
Size  outSize 
)

Resize image using Nearest neighbor sampling. Reduce width and height in half. (Native)

Parameters
inputnormalized grayscale input image
outputresized output image
outSizeoutput image size

◆ start_time()

void start_time ( system_clock::time_point &  startTime)

◆ statusBarUpdate()

void statusBarUpdate ( Mat &  part,
Mat &  totalResult,
int  idx,
int  portion,
bool  is_left 
)

Variable Documentation

◆ gKernel

double** gKernel
extern

◆ global_elapsed_Time

std::chrono::duration<double> global_elapsed_Time[4]
extern

◆ is_left

bool is_left
extern

◆ kSize

int kSize
extern

◆ partM

Mat partM[6]
extern

◆ totalResult

Mat totalResult
extern