/
vrd_sse.h
53 lines (46 loc) · 3.54 KB
/
vrd_sse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <stdint.h>
//! Run the Variance Ridge Detector on an input image
/*! This method simply chains together blurredVarianceSSE(), calculateGradientSSE(), and calculateRidgeSSE(), and is really the only
* method that users should need.
*
* \param[in] inputImage a w*h*4 float array containing the LABX image
* \param[in] w The width of the input image
* \param[in] h The height of the input image
* \param[in] r The desired radius of the ridge detector (a smaller radius will detect finer edges). A good default is 3.
* \param[out] outputImage a pointer to an allocated w*h chunk of floats where the output edge map will be written */
void vrd_sse(float const * const inputImage, int const w, int const h, int const r, float * outputImage);
//! Run the Variance Ridge Detector on an input image, and get the magnitude, x, and y gradients
/*! This method simply chains together blurredVarianceSSE(), calculateGradientSSE(), and calculateRidgeSSE(), and is really the only
* method that users should need.
*
* \param[in] inputImage a w*h*4 float array containing the LABX image
* \param[in] w The width of the input image
* \param[in] h The height of the input image
* \param[in] r The desired radius of the ridge detector (a smaller radius will detect finer edges). A good default is 3.
* \param[out] outputImage a pointer to an allocated w*h chunk of floats where the output edge map will be written
* \param[out] vGradient a pointer to an allocated w*h chunk of floats where the output vertical gradient will be written (horizontal edges)
* \param[out] hGradient a pointer to an allocated w*h chunk of floats where the output horizontal gradient will be written (vertical edges) */
void vrd_sse(float const * const inputImage, int const w, int const h, int const r, float * outputImage, float * vGradient, float * hGradient);
//! Calculate the blurred variance on an input image (Step 1 of VRD)
/*! \param[in] inputImage A w*h*4 float array containing the LABX image
* \param[in] w The width of the input image
* \param[in] h The height of the input image
* \param[in] r The desired blur radius
* \param[out] outputImage A pointer to an allocated w*h chunk of floats to be used as the output image */
void blurredVarianceSSE(float const * const inputImage, int const w, int const h, int const r, float * outputImage);
//! Calculate the gradient on an input image (Step 2 of VRD)
/*! \param[in] inputImage a w*h float array containing a grayscale image
* \param[in] w The width of the input image
* \param[in] h The height of the input image,
* \param[in] r The radius in which to calculate the gradient
* \param[out] gradX A pointer to an allocated w*h chunk of floats to be used as the horizontal gradient output
* \param[out] gradY A pointer to an allocated w*h chunk of floats to be used as the vertical gradient output */
void calculateGradientSSE(float const * const inputImage, int const w, int const h, int const r, float * gradX, float * gradY);
//! Calculate the ridge on a horizontal and vertical gradient (Step 3 of VRD)
/*! \param[in] gradX A w*h float array containing the horizontal gradient
* \param[in] gradY A w*h float array containing the vertical gradient
* \param[in] w The width of the images
* \param[in] h The height of the images
* \param[in] r The radius in which to calculate the ridge
* \param[out] ridgeImage A pointer to an allocated w*h chunk of floats to be used as the ridge output */
void calculateRidgeSSE(float const * const gradX, float const * const gradY, int const w, int const h, int const r, float * ridgeImage);