BOWImgDescriptorExtractor.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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/features2d.hpp"
  8. #else
  9. #define CV_EXPORTS
  10. #endif
  11. #import <Foundation/Foundation.h>
  12. @class KeyPoint;
  13. @class Mat;
  14. NS_ASSUME_NONNULL_BEGIN
  15. // C++: class BOWImgDescriptorExtractor
  16. /**
  17. * Class to compute an image descriptor using the *bag of visual words*.
  18. *
  19. * Such a computation consists of the following steps:
  20. *
  21. * 1. Compute descriptors for a given image and its keypoints set.
  22. * 2. Find the nearest visual words from the vocabulary for each keypoint descriptor.
  23. * 3. Compute the bag-of-words image descriptor as is a normalized histogram of vocabulary words
  24. * encountered in the image. The i-th bin of the histogram is a frequency of i-th word of the
  25. * vocabulary in the given image.
  26. *
  27. * Member of `Features2d`
  28. */
  29. CV_EXPORTS @interface BOWImgDescriptorExtractor : NSObject
  30. #ifdef __cplusplus
  31. @property(readonly)cv::Ptr<cv::BOWImgDescriptorExtractor> nativePtr;
  32. #endif
  33. #ifdef __cplusplus
  34. - (instancetype)initWithNativePtr:(cv::Ptr<cv::BOWImgDescriptorExtractor>)nativePtr;
  35. + (instancetype)fromNative:(cv::Ptr<cv::BOWImgDescriptorExtractor>)nativePtr;
  36. #endif
  37. #pragma mark - Methods
  38. //
  39. // cv::BOWImgDescriptorExtractor::BOWImgDescriptorExtractor(Ptr_DescriptorExtractor dextractor, Ptr_DescriptorMatcher dmatcher)
  40. //
  41. // Unknown type 'Ptr_DescriptorExtractor' (I), skipping the function
  42. //
  43. // void cv::BOWImgDescriptorExtractor::setVocabulary(Mat vocabulary)
  44. //
  45. /**
  46. * Sets a visual vocabulary.
  47. *
  48. * @param vocabulary Vocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the
  49. * vocabulary is a visual word (cluster center).
  50. */
  51. - (void)setVocabulary:(Mat*)vocabulary NS_SWIFT_NAME(setVocabulary(vocabulary:));
  52. //
  53. // Mat cv::BOWImgDescriptorExtractor::getVocabulary()
  54. //
  55. /**
  56. * Returns the set vocabulary.
  57. */
  58. - (Mat*)getVocabulary NS_SWIFT_NAME(getVocabulary());
  59. //
  60. // void cv::BOWImgDescriptorExtractor::compute2(Mat image, vector_KeyPoint keypoints, Mat& imgDescriptor)
  61. //
  62. /**
  63. *
  64. * @param imgDescriptor Computed output image descriptor.
  65. * pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary)
  66. * returned if it is non-zero.
  67. */
  68. - (void)compute:(Mat*)image keypoints:(NSArray<KeyPoint*>*)keypoints imgDescriptor:(Mat*)imgDescriptor NS_SWIFT_NAME(compute2(image:keypoints:imgDescriptor:));
  69. //
  70. // int cv::BOWImgDescriptorExtractor::descriptorSize()
  71. //
  72. /**
  73. * Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0.
  74. */
  75. - (int)descriptorSize NS_SWIFT_NAME(descriptorSize());
  76. //
  77. // int cv::BOWImgDescriptorExtractor::descriptorType()
  78. //
  79. /**
  80. * Returns an image descriptor type.
  81. */
  82. - (int)descriptorType NS_SWIFT_NAME(descriptorType());
  83. @end
  84. NS_ASSUME_NONNULL_END