Path: blob/master/modules/features2d/src/kaze/utils.h
16337 views
#ifndef __OPENCV_FEATURES_2D_KAZE_UTILS_H__1#define __OPENCV_FEATURES_2D_KAZE_UTILS_H__23/* ************************************************************************* */4/**5* @brief This function computes the value of a 2D Gaussian function6* @param x X Position7* @param y Y Position8* @param sig Standard Deviation9*/10inline float gaussian(float x, float y, float sigma) {11return expf(-(x*x + y*y) / (2.0f*sigma*sigma));12}1314/* ************************************************************************* */15/**16* @brief This function checks descriptor limits17* @param x X Position18* @param y Y Position19* @param width Image width20* @param height Image height21*/22inline void checkDescriptorLimits(int &x, int &y, int width, int height) {2324if (x < 0) {25x = 0;26}2728if (y < 0) {29y = 0;30}3132if (x > width - 1) {33x = width - 1;34}3536if (y > height - 1) {37y = height - 1;38}39}4041#endif424344