Download modules/features2d/src/kaze/utils.h from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 919 Bytes
-
https://huggingface.co/tgollogly/test/resolve/main/modules/features2d/src/kaze/utils.h
- Command line
-
hf download hf://tgollogly/test/modules/features2d/src/kaze/utils.h
-
curl -L -o utils.h https://huggingface.co/tgollogly/test/resolve/main/modules/features2d/src/kaze/utils.h
919 Bytes
| /* ************************************************************************* */ | |
| /** | |
| * @brief This function computes the value of a 2D Gaussian function | |
| * @param x X Position | |
| * @param y Y Position | |
| * @param sigma Standard Deviation | |
| */ | |
| inline float gaussian(float x, float y, float sigma) { | |
| return expf(-(x*x + y*y) / (2.0f*sigma*sigma)); | |
| } | |
| /* ************************************************************************* */ | |
| /** | |
| * @brief This function checks descriptor limits | |
| * @param x X Position | |
| * @param y Y Position | |
| * @param width Image width | |
| * @param height Image height | |
| */ | |
| inline void checkDescriptorLimits(int &x, int &y, int width, int height) { | |
| if (x < 0) { | |
| x = 0; | |
| } | |
| if (y < 0) { | |
| y = 0; | |
| } | |
| if (x > width - 1) { | |
| x = width - 1; | |
| } | |
| if (y > height - 1) { | |
| y = height - 1; | |
| } | |
| } | |