|
| 1 | +/*M/////////////////////////////////////////////////////////////////////////////////////// |
| 2 | +// |
| 3 | +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. |
| 4 | +// |
| 5 | +// By downloading, copying, installing or using the software you agree to this license. |
| 6 | +// If you do not agree to this license, do not download, install, |
| 7 | +// copy or use the software. |
| 8 | +// |
| 9 | +// |
| 10 | +// License Agreement |
| 11 | +// For Open Source Computer Vision Library |
| 12 | +// |
| 13 | +// Copyright (C) 2015, University of Ostrava, Institute for Research and Applications of Fuzzy Modeling, |
| 14 | +// Pavel Vlasanek, all rights reserved. Third party copyrights are property of their respective owners. |
| 15 | +// |
| 16 | +// Redistribution and use in source and binary forms, with or without modification, |
| 17 | +// are permitted provided that the following conditions are met: |
| 18 | +// |
| 19 | +// * Redistribution's of source code must retain the above copyright notice, |
| 20 | +// this list of conditions and the following disclaimer. |
| 21 | +// |
| 22 | +// * Redistribution's in binary form must reproduce the above copyright notice, |
| 23 | +// this list of conditions and the following disclaimer in the documentation |
| 24 | +// and/or other materials provided with the distribution. |
| 25 | +// |
| 26 | +// * The name of the copyright holders may not be used to endorse or promote products |
| 27 | +// derived from this software without specific prior written permission. |
| 28 | +// |
| 29 | +// This software is provided by the copyright holders and contributors "as is" and |
| 30 | +// any express or implied warranties, including, but not limited to, the implied |
| 31 | +// warranties of merchantability and fitness for a particular purpose are disclaimed. |
| 32 | +// In no event shall the Intel Corporation or contributors be liable for any direct, |
| 33 | +// indirect, incidental, special, exemplary, or consequential damages |
| 34 | +// (including, but not limited to, procurement of substitute goods or services; |
| 35 | +// loss of use, data, or profits; or business interruption) however caused |
| 36 | +// and on any theory of liability, whether in contract, strict liability, |
| 37 | +// or tort (including negligence or otherwise) arising in any way out of |
| 38 | +// the use of this software, even if advised of the possibility of such damage. |
| 39 | +// |
| 40 | +//M*/ |
| 41 | + |
| 42 | +#ifndef __OPENCV_FUZZY_F1_MATH_H__ |
| 43 | +#define __OPENCV_FUZZY_F1_MATH_H__ |
| 44 | + |
| 45 | +#include "opencv2/fuzzy/types.hpp" |
| 46 | +#include "opencv2/core.hpp" |
| 47 | + |
| 48 | +namespace cv |
| 49 | +{ |
| 50 | + |
| 51 | +namespace ft |
| 52 | +{ |
| 53 | + //! @addtogroup f1_math |
| 54 | + //! @{ |
| 55 | + |
| 56 | + /** @brief Computes components of the array using direct F1-transform. |
| 57 | + @param matrix Input array. |
| 58 | + @param kernel Kernel used for processing. Function **createKernel** can be used. |
| 59 | + @param components Output 32-bit float array for the components. |
| 60 | +
|
| 61 | + The function computes linear components using predefined kernel. |
| 62 | +
|
| 63 | + @note |
| 64 | + F-transform technique of first degreee is described in paper @cite Vlas:FT. |
| 65 | + */ |
| 66 | + CV_EXPORTS_W void FT12D_components(InputArray matrix, InputArray kernel, OutputArray components); |
| 67 | + |
| 68 | + /** @brief Computes elements of F1-transform components. |
| 69 | + @param matrix Input array. |
| 70 | + @param kernel Kernel used for processing. Function **createKernel** can be used. |
| 71 | + @param c00 Elements represent average color. |
| 72 | + @param c10 Elements represent average vertical gradient. |
| 73 | + @param c01 Elements represent average horizontal gradient. |
| 74 | + @param components Output 32-bit float array for the components. |
| 75 | + @param mask Mask can be used for unwanted area marking. |
| 76 | +
|
| 77 | + The function computes components and its elements using predefined kernel and mask. |
| 78 | +
|
| 79 | + @note |
| 80 | + F-transform technique of first degreee is described in paper @cite Vlas:FT. |
| 81 | + */ |
| 82 | + CV_EXPORTS_W void FT12D_polynomial(InputArray matrix, InputArray kernel, OutputArray c00, OutputArray c10, OutputArray c01, OutputArray components, InputArray mask = noArray()); |
| 83 | + |
| 84 | + /** @brief Creates vertical matrix for F1-transform computation. |
| 85 | + @param radius Radius of the basic function. |
| 86 | + @param matrix The vertical matrix. |
| 87 | + @param chn Number of channels. |
| 88 | +
|
| 89 | + The function creates helper vertical matrix for F1-transfrom processing. It is used for gradient computation. |
| 90 | + */ |
| 91 | + CV_EXPORTS_W void FT12D_createPolynomMatrixVertical(int radius, OutputArray matrix, const int chn); |
| 92 | + |
| 93 | + /** @brief Creates horizontal matrix for F1-transform computation. |
| 94 | + @param radius Radius of the basic function. |
| 95 | + @param matrix The horizontal matrix. |
| 96 | + @param chn Number of channels. |
| 97 | +
|
| 98 | + The function creates helper horizontal matrix for F1-transfrom processing. It is used for gradient computation. |
| 99 | + */ |
| 100 | + CV_EXPORTS_W void FT12D_createPolynomMatrixHorizontal(int radius, OutputArray matrix, const int chn); |
| 101 | + |
| 102 | + /** @brief Computes F1-transfrom and inverse F1-transfrom at once. |
| 103 | + @param matrix Input matrix. |
| 104 | + @param kernel Kernel used for processing. Function **createKernel** can be used. |
| 105 | + @param output Output 32-bit float array. |
| 106 | + @param mask Mask used for unwanted area marking. |
| 107 | +
|
| 108 | + This function computes F1-transfrom and inverse F1-transfotm in one step. It is fully sufficient and optimized for **Mat**. |
| 109 | + */ |
| 110 | + CV_EXPORTS_W void FT12D_process(InputArray matrix, InputArray kernel, OutputArray output, InputArray mask = noArray()); |
| 111 | + |
| 112 | + /** @brief Computes inverse F1-transfrom. |
| 113 | + @param components Input 32-bit float single channel array for the components. |
| 114 | + @param kernel Kernel used for processing. The same kernel as for components computation must be used. |
| 115 | + @param output Output 32-bit float array. |
| 116 | + @param width Width of the output array. |
| 117 | + @param height Height of the output array. |
| 118 | +
|
| 119 | + @note |
| 120 | + F-transform technique of first degreee is described in paper @cite Vlas:FT. |
| 121 | + */ |
| 122 | + CV_EXPORTS_W void FT12D_inverseFT(InputArray components, InputArray kernel, OutputArray output, int width, int height); |
| 123 | + |
| 124 | + //! @} |
| 125 | +} |
| 126 | +} |
| 127 | + |
| 128 | +#endif // __OPENCV_FUZZY_F1_MATH_H__ |
0 commit comments