fuzzy_F0_math.hpp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 F0-transform.
  52. @param matrix Input 1-channel array.
  53. @param kernel Kernel used for processing. Function **createKernel** can be used.
  54. @param components Output 32-bit 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. @note
  58. F-transform technique is described in paper @cite Perf:FT.
  59. */
  60. CV_EXPORTS void FT02D_components(InputArray matrix, InputArray kernel, OutputArray components, InputArray mask);
  61. /** @brief Computes components of the array using direct F0-transform.
  62. @param matrix Input 1-channel array.
  63. @param kernel Kernel used for processing. Function **createKernel** can be used.
  64. @param components Output 32-bit array for the components.
  65. The function computes components using predefined kernel.
  66. @note
  67. F-transform technique is described in paper @cite Perf:FT.
  68. */
  69. CV_EXPORTS void FT02D_components(InputArray matrix, InputArray kernel, OutputArray components);
  70. /** @brief Computes inverse F0-transfrom.
  71. @param components Input 32-bit array for the components.
  72. @param kernel Kernel used for processing. Function **createKernel** can be used.
  73. @param output Output 32-bit array.
  74. @param width Width of the output array.
  75. @param height Height of the output array.
  76. @note
  77. F-transform technique is described in paper @cite Perf:FT.
  78. */
  79. CV_EXPORTS void FT02D_inverseFT(InputArray components, InputArray kernel, OutputArray output, int width, int height);
  80. /** @brief Computes F0-transfrom and inverse F0-transfrom at once.
  81. @param image Input image.
  82. @param kernel Kernel used for processing. Function **createKernel** can be used.
  83. @param output Output 32-bit array.
  84. @param mask Mask used for unwanted area marking.
  85. This function computes F-transfrom and inverse F-transfotm in one step. It is fully sufficient and optimized for **Mat**.
  86. */
  87. CV_EXPORTS void FT02D_process(const Mat &image, const Mat &kernel, Mat &output, const Mat &mask);
  88. /** @brief Computes F0-transfrom and inverse F0-transfrom at once and return state.
  89. @param image Input image.
  90. @param kernel Kernel used for processing. Function **createKernel** can be used.
  91. @param imageOutput Output 32-bit array.
  92. @param mask Mask used for unwanted area marking.
  93. @param maskOutput Mask after one iteration.
  94. @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.
  95. This function computes iteration of F-transfrom and inverse F-transfotm and handle image and mask change. The function is used in *inpaint* function.
  96. */
  97. CV_EXPORTS int FT02D_iteration(const Mat &image, const Mat &kernel, Mat &imageOutput, const Mat &mask, Mat &maskOutput, bool firstStop = true);
  98. //! @}
  99. }
  100. }
  101. #endif // __OPENCV_FUZZY_F0_MATH_H__