SuperpixelLSC.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/ximgproc.hpp"
  8. #import "opencv2/ximgproc/lsc.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "Algorithm.h"
  14. @class Mat;
  15. NS_ASSUME_NONNULL_BEGIN
  16. // C++: class SuperpixelLSC
  17. /**
  18. * Class implementing the LSC (Linear Spectral Clustering) superpixels
  19. * algorithm described in CITE: LiCVPR2015LSC.
  20. *
  21. * LSC (Linear Spectral Clustering) produces compact and uniform superpixels with low
  22. * computational costs. Basically, a normalized cuts formulation of the superpixel
  23. * segmentation is adopted based on a similarity metric that measures the color
  24. * similarity and space proximity between image pixels. LSC is of linear computational
  25. * complexity and high memory efficiency and is able to preserve global properties of images
  26. *
  27. * Member of `Ximgproc`
  28. */
  29. CV_EXPORTS @interface SuperpixelLSC : Algorithm
  30. #ifdef __cplusplus
  31. @property(readonly)cv::Ptr<cv::ximgproc::SuperpixelLSC> nativePtrSuperpixelLSC;
  32. #endif
  33. #ifdef __cplusplus
  34. - (instancetype)initWithNativePtr:(cv::Ptr<cv::ximgproc::SuperpixelLSC>)nativePtr;
  35. + (instancetype)fromNative:(cv::Ptr<cv::ximgproc::SuperpixelLSC>)nativePtr;
  36. #endif
  37. #pragma mark - Methods
  38. //
  39. // int cv::ximgproc::SuperpixelLSC::getNumberOfSuperpixels()
  40. //
  41. /**
  42. * Calculates the actual amount of superpixels on a given segmentation computed
  43. * and stored in SuperpixelLSC object.
  44. */
  45. - (int)getNumberOfSuperpixels NS_SWIFT_NAME(getNumberOfSuperpixels());
  46. //
  47. // void cv::ximgproc::SuperpixelLSC::iterate(int num_iterations = 10)
  48. //
  49. /**
  50. * Calculates the superpixel segmentation on a given image with the initialized
  51. * parameters in the SuperpixelLSC object.
  52. *
  53. * This function can be called again without the need of initializing the algorithm with
  54. * createSuperpixelLSC(). This save the computational cost of allocating memory for all the
  55. * structures of the algorithm.
  56. *
  57. * @param num_iterations Number of iterations. Higher number improves the result.
  58. *
  59. * The function computes the superpixels segmentation of an image with the parameters initialized
  60. * with the function createSuperpixelLSC(). The algorithms starts from a grid of superpixels and
  61. * then refines the boundaries by proposing updates of edges boundaries.
  62. */
  63. - (void)iterate:(int)num_iterations NS_SWIFT_NAME(iterate(num_iterations:));
  64. /**
  65. * Calculates the superpixel segmentation on a given image with the initialized
  66. * parameters in the SuperpixelLSC object.
  67. *
  68. * This function can be called again without the need of initializing the algorithm with
  69. * createSuperpixelLSC(). This save the computational cost of allocating memory for all the
  70. * structures of the algorithm.
  71. *
  72. *
  73. * The function computes the superpixels segmentation of an image with the parameters initialized
  74. * with the function createSuperpixelLSC(). The algorithms starts from a grid of superpixels and
  75. * then refines the boundaries by proposing updates of edges boundaries.
  76. */
  77. - (void)iterate NS_SWIFT_NAME(iterate());
  78. //
  79. // void cv::ximgproc::SuperpixelLSC::getLabels(Mat& labels_out)
  80. //
  81. /**
  82. * Returns the segmentation labeling of the image.
  83. *
  84. * Each label represents a superpixel, and each pixel is assigned to one superpixel label.
  85. *
  86. * @param labels_out Return: A CV_32SC1 integer array containing the labels of the superpixel
  87. * segmentation. The labels are in the range [0, getNumberOfSuperpixels()].
  88. *
  89. * The function returns an image with the labels of the superpixel segmentation. The labels are in
  90. * the range [0, getNumberOfSuperpixels()].
  91. */
  92. - (void)getLabels:(Mat*)labels_out NS_SWIFT_NAME(getLabels(labels_out:));
  93. //
  94. // void cv::ximgproc::SuperpixelLSC::getLabelContourMask(Mat& image, bool thick_line = true)
  95. //
  96. /**
  97. * Returns the mask of the superpixel segmentation stored in SuperpixelLSC object.
  98. *
  99. * @param image Return: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border,
  100. * and 0 otherwise.
  101. *
  102. * @param thick_line If false, the border is only one pixel wide, otherwise all pixels at the border
  103. * are masked.
  104. *
  105. * The function return the boundaries of the superpixel segmentation.
  106. */
  107. - (void)getLabelContourMask:(Mat*)image thick_line:(BOOL)thick_line NS_SWIFT_NAME(getLabelContourMask(image:thick_line:));
  108. /**
  109. * Returns the mask of the superpixel segmentation stored in SuperpixelLSC object.
  110. *
  111. * @param image Return: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border,
  112. * and 0 otherwise.
  113. *
  114. * are masked.
  115. *
  116. * The function return the boundaries of the superpixel segmentation.
  117. */
  118. - (void)getLabelContourMask:(Mat*)image NS_SWIFT_NAME(getLabelContourMask(image:));
  119. //
  120. // void cv::ximgproc::SuperpixelLSC::enforceLabelConnectivity(int min_element_size = 25)
  121. //
  122. /**
  123. * Enforce label connectivity.
  124. *
  125. * @param min_element_size The minimum element size in percents that should be absorbed into a bigger
  126. * superpixel. Given resulted average superpixel size valid value should be in 0-100 range, 25 means
  127. * that less then a quarter sized superpixel should be absorbed, this is default.
  128. *
  129. * The function merge component that is too small, assigning the previously found adjacent label
  130. * to this component. Calling this function may change the final number of superpixels.
  131. */
  132. - (void)enforceLabelConnectivity:(int)min_element_size NS_SWIFT_NAME(enforceLabelConnectivity(min_element_size:));
  133. /**
  134. * Enforce label connectivity.
  135. *
  136. * superpixel. Given resulted average superpixel size valid value should be in 0-100 range, 25 means
  137. * that less then a quarter sized superpixel should be absorbed, this is default.
  138. *
  139. * The function merge component that is too small, assigning the previously found adjacent label
  140. * to this component. Calling this function may change the final number of superpixels.
  141. */
  142. - (void)enforceLabelConnectivity NS_SWIFT_NAME(enforceLabelConnectivity());
  143. @end
  144. NS_ASSUME_NONNULL_END