fuzzy_F0_math.hpp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. #ifndef __OPENCV_FUZZY_F0_MATH_H__
  42. #define __OPENCV_FUZZY_F0_MATH_H__
  43. #include "opencv2/fuzzy/types.hpp"
  44. #include "opencv2/core.hpp"
  45. namespace cv
  46. {
  47. namespace ft
  48. {
  49. //! @addtogroup f0_math
  50. //! @{
  51. /** @brief Computes components of the array using direct \f$F^0\f$-transform.
  52. @param matrix Input array.
  53. @param kernel Kernel used for processing. Function `ft::createKernel` can be used.
  54. @param components Output 32-bit float array for the components.
  55. @param mask Mask can be used for unwanted area marking.
  56. The function computes components using predefined kernel and mask.
  57. */
  58. CV_EXPORTS_W void FT02D_components(InputArray matrix, InputArray kernel, OutputArray components, InputArray mask = noArray());
  59. /** @brief Computes inverse \f$F^0\f$-transfrom.
  60. @param components Input 32-bit float single channel array for the components.
  61. @param kernel Kernel used for processing. Function `ft::createKernel` can be used.
  62. @param output Output 32-bit float array.
  63. @param width Width of the output array.
  64. @param height Height of the output array.
  65. Computation of inverse F-transform.
  66. */
  67. CV_EXPORTS_W void FT02D_inverseFT(InputArray components, InputArray kernel, OutputArray output, int width, int height);
  68. /** @brief Computes \f$F^0\f$-transfrom and inverse \f$F^0\f$-transfrom at once.
  69. @param matrix Input matrix.
  70. @param kernel Kernel used for processing. Function `ft::createKernel` can be used.
  71. @param output Output 32-bit float array.
  72. @param mask Mask used for unwanted area marking.
  73. This function computes F-transfrom and inverse F-transfotm in one step. It is fully sufficient and optimized for `cv::Mat`.
  74. */
  75. CV_EXPORTS_W void FT02D_process(InputArray matrix, InputArray kernel, OutputArray output, InputArray mask = noArray());
  76. /** @brief Computes \f$F^0\f$-transfrom and inverse \f$F^0\f$-transfrom at once and return state.
  77. @param matrix Input matrix.
  78. @param kernel Kernel used for processing. Function `ft::createKernel` can be used.
  79. @param output Output 32-bit float array.
  80. @param mask Mask used for unwanted area marking.
  81. @param maskOutput Mask after one iteration.
  82. @param firstStop If **true** function returns -1 when first problem appears. In case of `false` the process is completed and summation of all problems returned.
  83. This function computes iteration of F-transfrom and inverse F-transfotm and handle image and mask change. The function is used in `ft::inpaint` function.
  84. */
  85. CV_EXPORTS_W int FT02D_iteration(InputArray matrix, InputArray kernel, OutputArray output, InputArray mask, OutputArray maskOutput, bool firstStop);
  86. /** @brief Sligtly less accurate version of \f$F^0\f$-transfrom computation optimized for higher speed. The methods counts with linear basic function.
  87. @param matrix Input 3 channels matrix.
  88. @param radius Radius of the `ft::LINEAR` basic function.
  89. @param output Output array.
  90. This function computes F-transfrom and inverse F-transfotm using linear basic function in one step. It is ~10 times faster than `ft::FT02D_process` method.
  91. */
  92. CV_EXPORTS_W void FT02D_FL_process(InputArray matrix, const int radius, OutputArray output);
  93. /** @brief Sligtly less accurate version of \f$F^0\f$-transfrom computation optimized for higher speed. The methods counts with linear basic function.
  94. @param matrix Input 3 channels matrix.
  95. @param radius Radius of the `ft::LINEAR` basic function.
  96. @param output Output array.
  97. This function computes F-transfrom and inverse F-transfotm using linear basic function in one step. It is ~9 times faster then `ft::FT02D_process` method and more accurate than `ft::FT02D_FL_process` method.
  98. */
  99. CV_EXPORTS_W void FT02D_FL_process_float(InputArray matrix, const int radius, OutputArray output);
  100. //! @}
  101. }
  102. }
  103. #endif // __OPENCV_FUZZY_F0_MATH_H__