openCV library for Renesas RZ/A

Dependents:   RZ_A2M_Mbed_samples

Committer:
RyoheiHagimoto
Date:
Fri Jan 29 04:53:38 2021 +0000
Revision:
0:0e0631af0305
copied from https://github.com/d-kato/opencv-lib.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RyoheiHagimoto 0:0e0631af0305 1 /*M///////////////////////////////////////////////////////////////////////////////////////
RyoheiHagimoto 0:0e0631af0305 2 //
RyoheiHagimoto 0:0e0631af0305 3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
RyoheiHagimoto 0:0e0631af0305 4 //
RyoheiHagimoto 0:0e0631af0305 5 // By downloading, copying, installing or using the software you agree to this license.
RyoheiHagimoto 0:0e0631af0305 6 // If you do not agree to this license, do not download, install,
RyoheiHagimoto 0:0e0631af0305 7 // copy or use the software.
RyoheiHagimoto 0:0e0631af0305 8 //
RyoheiHagimoto 0:0e0631af0305 9 //
RyoheiHagimoto 0:0e0631af0305 10 // License Agreement
RyoheiHagimoto 0:0e0631af0305 11 // For Open Source Computer Vision Library
RyoheiHagimoto 0:0e0631af0305 12 //
RyoheiHagimoto 0:0e0631af0305 13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
RyoheiHagimoto 0:0e0631af0305 14 // Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.
RyoheiHagimoto 0:0e0631af0305 15 // Third party copyrights are property of their respective owners.
RyoheiHagimoto 0:0e0631af0305 16 //
RyoheiHagimoto 0:0e0631af0305 17 // Redistribution and use in source and binary forms, with or without modification,
RyoheiHagimoto 0:0e0631af0305 18 // are permitted provided that the following conditions are met:
RyoheiHagimoto 0:0e0631af0305 19 //
RyoheiHagimoto 0:0e0631af0305 20 // * Redistribution's of source code must retain the above copyright notice,
RyoheiHagimoto 0:0e0631af0305 21 // this list of conditions and the following disclaimer.
RyoheiHagimoto 0:0e0631af0305 22 //
RyoheiHagimoto 0:0e0631af0305 23 // * Redistribution's in binary form must reproduce the above copyright notice,
RyoheiHagimoto 0:0e0631af0305 24 // this list of conditions and the following disclaimer in the documentation
RyoheiHagimoto 0:0e0631af0305 25 // and/or other materials provided with the distribution.
RyoheiHagimoto 0:0e0631af0305 26 //
RyoheiHagimoto 0:0e0631af0305 27 // * The name of the copyright holders may not be used to endorse or promote products
RyoheiHagimoto 0:0e0631af0305 28 // derived from this software without specific prior written permission.
RyoheiHagimoto 0:0e0631af0305 29 //
RyoheiHagimoto 0:0e0631af0305 30 // This software is provided by the copyright holders and contributors "as is" and
RyoheiHagimoto 0:0e0631af0305 31 // any express or implied warranties, including, but not limited to, the implied
RyoheiHagimoto 0:0e0631af0305 32 // warranties of merchantability and fitness for a particular purpose are disclaimed.
RyoheiHagimoto 0:0e0631af0305 33 // In no event shall the Intel Corporation or contributors be liable for any direct,
RyoheiHagimoto 0:0e0631af0305 34 // indirect, incidental, special, exemplary, or consequential damages
RyoheiHagimoto 0:0e0631af0305 35 // (including, but not limited to, procurement of substitute goods or services;
RyoheiHagimoto 0:0e0631af0305 36 // loss of use, data, or profits; or business interruption) however caused
RyoheiHagimoto 0:0e0631af0305 37 // and on any theory of liability, whether in contract, strict liability,
RyoheiHagimoto 0:0e0631af0305 38 // or tort (including negligence or otherwise) arising in any way out of
RyoheiHagimoto 0:0e0631af0305 39 // the use of this software, even if advised of the possibility of such damage.
RyoheiHagimoto 0:0e0631af0305 40 //
RyoheiHagimoto 0:0e0631af0305 41 //M*/
RyoheiHagimoto 0:0e0631af0305 42
RyoheiHagimoto 0:0e0631af0305 43 #ifndef OPENCV_PHOTO_CUDA_HPP
RyoheiHagimoto 0:0e0631af0305 44 #define OPENCV_PHOTO_CUDA_HPP
RyoheiHagimoto 0:0e0631af0305 45
RyoheiHagimoto 0:0e0631af0305 46 #include "opencv2/core/cuda.hpp"
RyoheiHagimoto 0:0e0631af0305 47
RyoheiHagimoto 0:0e0631af0305 48 namespace cv { namespace cuda {
RyoheiHagimoto 0:0e0631af0305 49
RyoheiHagimoto 0:0e0631af0305 50 //! @addtogroup photo_denoise
RyoheiHagimoto 0:0e0631af0305 51 //! @{
RyoheiHagimoto 0:0e0631af0305 52
RyoheiHagimoto 0:0e0631af0305 53 /** @brief Performs pure non local means denoising without any simplification, and thus it is not fast.
RyoheiHagimoto 0:0e0631af0305 54
RyoheiHagimoto 0:0e0631af0305 55 @param src Source image. Supports only CV_8UC1, CV_8UC2 and CV_8UC3.
RyoheiHagimoto 0:0e0631af0305 56 @param dst Destination image.
RyoheiHagimoto 0:0e0631af0305 57 @param h Filter sigma regulating filter strength for color.
RyoheiHagimoto 0:0e0631af0305 58 @param search_window Size of search window.
RyoheiHagimoto 0:0e0631af0305 59 @param block_size Size of block used for computing weights.
RyoheiHagimoto 0:0e0631af0305 60 @param borderMode Border type. See borderInterpolate for details. BORDER_REFLECT101 ,
RyoheiHagimoto 0:0e0631af0305 61 BORDER_REPLICATE , BORDER_CONSTANT , BORDER_REFLECT and BORDER_WRAP are supported for now.
RyoheiHagimoto 0:0e0631af0305 62 @param stream Stream for the asynchronous version.
RyoheiHagimoto 0:0e0631af0305 63
RyoheiHagimoto 0:0e0631af0305 64 @sa
RyoheiHagimoto 0:0e0631af0305 65 fastNlMeansDenoising
RyoheiHagimoto 0:0e0631af0305 66 */
RyoheiHagimoto 0:0e0631af0305 67 CV_EXPORTS void nonLocalMeans(InputArray src, OutputArray dst,
RyoheiHagimoto 0:0e0631af0305 68 float h,
RyoheiHagimoto 0:0e0631af0305 69 int search_window = 21,
RyoheiHagimoto 0:0e0631af0305 70 int block_size = 7,
RyoheiHagimoto 0:0e0631af0305 71 int borderMode = BORDER_DEFAULT,
RyoheiHagimoto 0:0e0631af0305 72 Stream& stream = Stream::Null());
RyoheiHagimoto 0:0e0631af0305 73
RyoheiHagimoto 0:0e0631af0305 74 /** @brief Perform image denoising using Non-local Means Denoising algorithm
RyoheiHagimoto 0:0e0631af0305 75 <http://www.ipol.im/pub/algo/bcm_non_local_means_denoising> with several computational
RyoheiHagimoto 0:0e0631af0305 76 optimizations. Noise expected to be a gaussian white noise
RyoheiHagimoto 0:0e0631af0305 77
RyoheiHagimoto 0:0e0631af0305 78 @param src Input 8-bit 1-channel, 2-channel or 3-channel image.
RyoheiHagimoto 0:0e0631af0305 79 @param dst Output image with the same size and type as src .
RyoheiHagimoto 0:0e0631af0305 80 @param h Parameter regulating filter strength. Big h value perfectly removes noise but also
RyoheiHagimoto 0:0e0631af0305 81 removes image details, smaller h value preserves details but also preserves some noise
RyoheiHagimoto 0:0e0631af0305 82 @param search_window Size in pixels of the window that is used to compute weighted average for
RyoheiHagimoto 0:0e0631af0305 83 given pixel. Should be odd. Affect performance linearly: greater search_window - greater
RyoheiHagimoto 0:0e0631af0305 84 denoising time. Recommended value 21 pixels
RyoheiHagimoto 0:0e0631af0305 85 @param block_size Size in pixels of the template patch that is used to compute weights. Should be
RyoheiHagimoto 0:0e0631af0305 86 odd. Recommended value 7 pixels
RyoheiHagimoto 0:0e0631af0305 87 @param stream Stream for the asynchronous invocations.
RyoheiHagimoto 0:0e0631af0305 88
RyoheiHagimoto 0:0e0631af0305 89 This function expected to be applied to grayscale images. For colored images look at
RyoheiHagimoto 0:0e0631af0305 90 FastNonLocalMeansDenoising::labMethod.
RyoheiHagimoto 0:0e0631af0305 91
RyoheiHagimoto 0:0e0631af0305 92 @sa
RyoheiHagimoto 0:0e0631af0305 93 fastNlMeansDenoising
RyoheiHagimoto 0:0e0631af0305 94 */
RyoheiHagimoto 0:0e0631af0305 95 CV_EXPORTS void fastNlMeansDenoising(InputArray src, OutputArray dst,
RyoheiHagimoto 0:0e0631af0305 96 float h,
RyoheiHagimoto 0:0e0631af0305 97 int search_window = 21,
RyoheiHagimoto 0:0e0631af0305 98 int block_size = 7,
RyoheiHagimoto 0:0e0631af0305 99 Stream& stream = Stream::Null());
RyoheiHagimoto 0:0e0631af0305 100
RyoheiHagimoto 0:0e0631af0305 101 /** @brief Modification of fastNlMeansDenoising function for colored images
RyoheiHagimoto 0:0e0631af0305 102
RyoheiHagimoto 0:0e0631af0305 103 @param src Input 8-bit 3-channel image.
RyoheiHagimoto 0:0e0631af0305 104 @param dst Output image with the same size and type as src .
RyoheiHagimoto 0:0e0631af0305 105 @param h_luminance Parameter regulating filter strength. Big h value perfectly removes noise but
RyoheiHagimoto 0:0e0631af0305 106 also removes image details, smaller h value preserves details but also preserves some noise
RyoheiHagimoto 0:0e0631af0305 107 @param photo_render float The same as h but for color components. For most images value equals 10 will be
RyoheiHagimoto 0:0e0631af0305 108 enough to remove colored noise and do not distort colors
RyoheiHagimoto 0:0e0631af0305 109 @param search_window Size in pixels of the window that is used to compute weighted average for
RyoheiHagimoto 0:0e0631af0305 110 given pixel. Should be odd. Affect performance linearly: greater search_window - greater
RyoheiHagimoto 0:0e0631af0305 111 denoising time. Recommended value 21 pixels
RyoheiHagimoto 0:0e0631af0305 112 @param block_size Size in pixels of the template patch that is used to compute weights. Should be
RyoheiHagimoto 0:0e0631af0305 113 odd. Recommended value 7 pixels
RyoheiHagimoto 0:0e0631af0305 114 @param stream Stream for the asynchronous invocations.
RyoheiHagimoto 0:0e0631af0305 115
RyoheiHagimoto 0:0e0631af0305 116 The function converts image to CIELAB colorspace and then separately denoise L and AB components
RyoheiHagimoto 0:0e0631af0305 117 with given h parameters using FastNonLocalMeansDenoising::simpleMethod function.
RyoheiHagimoto 0:0e0631af0305 118
RyoheiHagimoto 0:0e0631af0305 119 @sa
RyoheiHagimoto 0:0e0631af0305 120 fastNlMeansDenoisingColored
RyoheiHagimoto 0:0e0631af0305 121 */
RyoheiHagimoto 0:0e0631af0305 122 CV_EXPORTS void fastNlMeansDenoisingColored(InputArray src, OutputArray dst,
RyoheiHagimoto 0:0e0631af0305 123 float h_luminance, float photo_render,
RyoheiHagimoto 0:0e0631af0305 124 int search_window = 21,
RyoheiHagimoto 0:0e0631af0305 125 int block_size = 7,
RyoheiHagimoto 0:0e0631af0305 126 Stream& stream = Stream::Null());
RyoheiHagimoto 0:0e0631af0305 127
RyoheiHagimoto 0:0e0631af0305 128 //! @} photo
RyoheiHagimoto 0:0e0631af0305 129
RyoheiHagimoto 0:0e0631af0305 130 }} // namespace cv { namespace cuda {
RyoheiHagimoto 0:0e0631af0305 131
RyoheiHagimoto 0:0e0631af0305 132 #endif /* OPENCV_PHOTO_CUDA_HPP */