Class: OpenCV::Cv::Flann::Index
- Inherits:
-
Object
- Object
- OpenCV::Cv::Flann::Index
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ropencv/ropencv_types.rb
Class Method Summary collapse
- .new(*args) ⇒ Object
-
.null ⇒ Object
returns a null pointer to the object.
Instance Method Summary collapse
-
#build(features, params, dist_type = cvflann::FLANN_DIST_L2) ⇒ Void
methods.
- #get_algorithm ⇒ Cvflann::Flann_Algorithm_T (also: #getAlgorithm)
- #get_distance ⇒ Cvflann::Flann_Distance_T (also: #getDistance)
- #knn_search(query, indices, dists, knn, params = Cv::Flann::SearchParams.new()) ⇒ Void (also: #knnSearch)
- #load(features, filename) ⇒ Bool
- #radius_search(query, indices, dists, radius, max_results, params = Cv::Flann::SearchParams.new()) ⇒ Fixnum (also: #radiusSearch)
- #release ⇒ Void
- #save(filename) ⇒ Void
-
#to_s ⇒ Object
converts Index into a string by crawling through all its attributes.
Class Method Details
.index ⇒ Object .index(features, params, dist_type = cvflann::FLANN_DIST_L2) ⇒ Object
11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 |
# File 'lib/ropencv/ropencv_types.rb', line 11822 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(IndexStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # overloaded method wrapper for cv::flann::Index::Index() @@cv_flann_index_index_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@cv_flann_index_index_defaults0[i] end begin return Rbind::cv_flann_index_index(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for cv::flann::Index::Index(const cv::Mat features, const cv::flann::IndexParams params, const cvflann::flann_distance_t distType = cvflann::FLANN_DIST_L2) @@cv_flann_index_index2_defaults1 ||= [nil, nil, cvflann::FLANN_DIST_L2] if(args.size >= 2 && args.size <= 3) targs = args.clone targs.size.upto(2) do |i| targs[i] = @@cv_flann_index_index2_defaults1[i] end begin return Rbind::cv_flann_index_index2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.null ⇒ Object
returns a null pointer to the object
11812 11813 11814 |
# File 'lib/ropencv/ropencv_types.rb', line 11812 def self.null new(IndexStruct.new) end |
Instance Method Details
#build(features, params, dist_type = cvflann::FLANN_DIST_L2) ⇒ Void
method wrapper for void cv::flann::Index::build(const cv::Mat features, const cv::flann::IndexParams params, const cvflann::flann_distance_t distType = cvflann::FLANN_DIST_L2)
methods
11936 11937 11938 11939 |
# File 'lib/ropencv/ropencv_types.rb', line 11936 def build(features, params, dist_type = cvflann::FLANN_DIST_L2) __validate_pointer__ Rbind::cv_flann_index_build( self, features, params, dist_type) end |
#get_algorithm ⇒ Cvflann::Flann_Algorithm_T Also known as: getAlgorithm
method wrapper for cvflann::flann_algorithm_t cv::flann::Index::getAlgorithm()
12007 12008 12009 12010 12011 12012 12013 12014 12015 |
# File 'lib/ropencv/ropencv_types.rb', line 12007 def get_algorithm() __validate_pointer__ result = Rbind::cv_flann_index_get_algorithm( self) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#get_distance ⇒ Cvflann::Flann_Distance_T Also known as: getDistance
method wrapper for cvflann::flann_distance_t cv::flann::Index::getDistance()
11994 11995 11996 11997 11998 11999 12000 12001 12002 |
# File 'lib/ropencv/ropencv_types.rb', line 11994 def get_distance() __validate_pointer__ result = Rbind::cv_flann_index_get_distance( self) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#knn_search(query, indices, dists, knn, params = Cv::Flann::SearchParams.new()) ⇒ Void Also known as: knnSearch
method wrapper for void cv::flann::Index::knnSearch(const cv::Mat query, cv::Mat& indices, cv::Mat& dists, int knn, const cv::flann::SearchParams params = SearchParams())
11948 11949 11950 11951 |
# File 'lib/ropencv/ropencv_types.rb', line 11948 def knn_search(query, indices, dists, knn, params = Cv::Flann::SearchParams.new()) __validate_pointer__ Rbind::cv_flann_index_knn_search( self, query, indices, dists, knn, params) end |
#load(features, filename) ⇒ Bool
method wrapper for bool cv::flann::Index::load(const cv::Mat features, const cv::String filename)
11980 11981 11982 11983 |
# File 'lib/ropencv/ropencv_types.rb', line 11980 def load(features, filename) __validate_pointer__ Rbind::cv_flann_index_load( self, features, filename) end |
#radius_search(query, indices, dists, radius, max_results, params = Cv::Flann::SearchParams.new()) ⇒ Fixnum Also known as: radiusSearch
method wrapper for int cv::flann::Index::radiusSearch(const cv::Mat query, cv::Mat& indices, cv::Mat& dists, double radius, int maxResults, const cv::flann::SearchParams params = SearchParams())
11962 11963 11964 11965 |
# File 'lib/ropencv/ropencv_types.rb', line 11962 def radius_search(query, indices, dists, radius, max_results, params = Cv::Flann::SearchParams.new()) __validate_pointer__ Rbind::cv_flann_index_radius_search( self, query, indices, dists, radius, max_results, params) end |
#release ⇒ Void
method wrapper for void cv::flann::Index::release()
11987 11988 11989 11990 |
# File 'lib/ropencv/ropencv_types.rb', line 11987 def release() __validate_pointer__ Rbind::cv_flann_index_release( self) end |
#save(filename) ⇒ Void
method wrapper for void cv::flann::Index::save(const cv::String filename)
11971 11972 11973 11974 |
# File 'lib/ropencv/ropencv_types.rb', line 11971 def save(filename) __validate_pointer__ Rbind::cv_flann_index_save( self, filename) end |
#to_s ⇒ Object
converts Index into a string by crawling through all its attributes
11922 11923 11924 |
# File 'lib/ropencv/ropencv_types.rb', line 11922 def to_s "#<cv::flann::Index >" end |