Commit c4448862 authored by Erik Karlsson's avatar Erik Karlsson

Changed parameters of fastNlMeansDenoising[Multi][Abs] from float * to std::vector<float>

parent 21160137
......@@ -149,10 +149,10 @@ Should be odd. Recommended value 7 pixels
@param searchWindowSize Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
@param h Array of parameters regulating filter strength, one per
channel. Big h value perfectly removes noise but also removes image
details, smaller h value preserves details but also preserves some
noise
@param h Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in src. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
......@@ -160,7 +160,7 @@ image in different colorspaces. Such approach is used in fastNlMeansDenoisingCol
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.
*/
CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, float *h,
CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, std::vector<float> h,
int templateWindowSize = 7, int searchWindowSize = 21);
/** @brief Perform image denoising using Non-local Means Denoising
......@@ -201,10 +201,10 @@ Should be odd. Recommended value 7 pixels
@param searchWindowSize Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
@param h Array of parameters regulating filter strength, one per
channel. Big h value perfectly removes noise but also removes image
details, smaller h value preserves details but also preserves some
noise
@param h Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in src. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
......@@ -212,7 +212,7 @@ image in different colorspaces. Such approach is used in fastNlMeansDenoisingCol
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.
*/
CV_EXPORTS_W void fastNlMeansDenoisingAbs( InputArray src, OutputArray dst, float *h,
CV_EXPORTS_W void fastNlMeansDenoisingAbs( InputArray src, OutputArray dst, std::vector<float> h,
int templateWindowSize = 7, int searchWindowSize = 21);
/** @brief Modification of fastNlMeansDenoising function for colored images
......@@ -283,14 +283,14 @@ Should be odd. Recommended value 7 pixels
@param searchWindowSize Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
@param h Array of parameters regulating filter strength, one for each
channel. Bigger h value perfectly removes noise but also removes image
details, smaller h value preserves details but also preserves some
noise
@param h Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in src. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noise
*/
CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst,
int imgToDenoiseIndex, int temporalWindowSize,
float *h , int templateWindowSize = 7, int searchWindowSize = 21);
std::vector<float> h , int templateWindowSize = 7, int searchWindowSize = 21);
/** @brief Modification of fastNlMeansDenoising function for images
sequence where consequtive images have been captured in small period
......@@ -346,14 +346,14 @@ Should be odd. Recommended value 7 pixels
@param searchWindowSize Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
@param h Array of parameters regulating filter strength, one for each
channel. Bigger h value perfectly removes noise but also removes image
details, smaller h value preserves details but also preserves some
noise
@param h Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in src. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noise
*/
CV_EXPORTS_W void fastNlMeansDenoisingMultiAbs( InputArrayOfArrays srcImgs, OutputArray dst,
int imgToDenoiseIndex, int temporalWindowSize,
float *h, int templateWindowSize = 7, int searchWindowSize = 21);
std::vector<float> h, int templateWindowSize = 7, int searchWindowSize = 21);
/** @brief Modification of fastNlMeansDenoisingMulti function for colored images sequences
......
This diff is collapsed.
......@@ -16,7 +16,7 @@ namespace ocl {
PARAM_TEST_CASE(FastNlMeansDenoisingTestBase, Channels, bool, bool)
{
int cn, templateWindowSize, searchWindowSize;
float h[4];
std::vector<float> h;
bool use_roi, use_image;
TEST_DECLARE_INPUT_PARAMETER(src);
......@@ -31,7 +31,7 @@ PARAM_TEST_CASE(FastNlMeansDenoisingTestBase, Channels, bool, bool)
templateWindowSize = 7;
searchWindowSize = 21;
ASSERT_TRUE(cn > 0 && cn <= 4);
h.resize(cn);
for (int i=0; i<cn; i++)
h[i] = 3.0f + 0.5f*i;
}
......@@ -51,6 +51,7 @@ PARAM_TEST_CASE(FastNlMeansDenoisingTestBase, Channels, bool, bool)
Border srcBorder = randomBorder(0, use_roi ? MAX_VALUE : 0);
randomSubMat(src, src_roi, roiSize, srcBorder, type, 0, 255);
if (use_image) {
ASSERT_TRUE(cn > 0 && cn <= 4);
if (cn == 2) {
int from_to[] = { 0,0, 1,1 };
src_roi.create(roiSize, type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment