Class: OpenCV::Cv::BFMatcher

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Defined in:
lib/ruby/ropencv/ropencv_types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ BFMatcher

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of BFMatcher.



11905
11906
11907
11908
11909
11910
11911
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11905

def initialize(ptr)
    @__obj_ptr__ = if ptr.is_a? BFMatcherStruct
                       ptr
                   else
                       BFMatcherStruct.new(FFI::AutoPointer.new(ptr,BFMatcherStruct.method(:release)))
                   end
end

Instance Attribute Details

#__obj_ptr__Object (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11902
11903
11904
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11902

def __obj_ptr__
  @__obj_ptr__
end

Class Method Details

._create(name) ⇒ Object

wrapper for Ptr_Algorithm cv::BFMatcher::_create(const cv::String name)



12130
12131
12132
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12130

def self._create(name)
    Rbind::cv_bf_matcher__create(name)
end

.create(descriptor_matcher_type) ⇒ Object

wrapper for Ptr_DescriptorMatcher cv::BFMatcher::create(const cv::String descriptorMatcherType)



12020
12021
12022
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12020

def self.create(descriptor_matcher_type)
    Rbind::cv_bf_matcher_create(descriptor_matcher_type)
end

.from_native(ptr, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

can be overwritten by the user



11897
11898
11899
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11897

def self.from_native(ptr,context)
    rbind_from_native(ptr,context)
end

.get_list(algorithms) ⇒ Object

wrapper for void cv::BFMatcher::getList(vector_string algorithms)



12125
12126
12127
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12125

def self.get_list(algorithms)
    Rbind::cv_bf_matcher_get_list(algorithms)
end

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11854

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(BFMatcherStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for cv::BFMatcher::BFMatcher(int normType=NORM_L2, bool crossCheck=false)
    @@cv_bf_matcher_bf_matcher_defaults0 ||= [NORM_L2, false]
    if(args.size >= 0 && args.size <= 2)
        args.size.upto(1) do |i|
            args[i] = @@cv_bf_matcher_bf_matcher_defaults0[i]
        end
        begin
            return Rbind::cv_bf_matcher_bf_matcher(*args)
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "no constructor for #{self}(#{args.inspect})"
end

.rbind_from_native(ptr, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11885
11886
11887
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11885

def self.rbind_from_native(ptr,context)
    BFMatcher.new(ptr)
end

.rbind_to_native(obj, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11876
11877
11878
11879
11880
11881
11882
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11876

def self.rbind_to_native(obj,context)
    if obj.is_a? BFMatcher
        obj.__obj_ptr__
    else
        raise TypeError, "expected kind of #{name}, was #{obj.class}"
    end
end

.to_native(obj, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

can be overwritten by the user



11891
11892
11893
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11891

def self.to_native(obj,context)
    rbind_to_native(obj,context)
end

Instance Method Details

#__owner__?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

returns true if the underlying pointer is owner of the real object

Returns:

  • (Boolean)


11916
11917
11918
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11916

def __owner__?
    @__obj_ptr__[:bowner]
end

#add(descriptors) ⇒ Object

methods wrapper for void cv::BFMatcher::add(const vector_Mat descriptors)



11930
11931
11932
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11930

def add(descriptors)
    Rbind::cv_bf_matcher_add( self, descriptors)
end

#clearObject

wrapper for void cv::BFMatcher::clear()



11943
11944
11945
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11943

def clear()
    Rbind::cv_bf_matcher_clear( self)
end

#emptyObject

wrapper for bool cv::BFMatcher::empty()



11948
11949
11950
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11948

def empty()
    Rbind::cv_bf_matcher_empty( self)
end

#get_algorithm(name) ⇒ Object

wrapper for Ptr_Algorithm cv::BFMatcher::getAlgorithm(const cv::String name)



12064
12065
12066
12067
12068
12069
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12064

def get_algorithm(name)
    result = Rbind::cv_bf_matcher_get_algorithm( self, name)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#get_bool(name) ⇒ Object

wrapper for bool cv::BFMatcher::getBool(const cv::String name)



12035
12036
12037
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12035

def get_bool(name)
    Rbind::cv_bf_matcher_get_bool( self, name)
end

#get_double(name) ⇒ Object

wrapper for double cv::BFMatcher::getDouble(const cv::String name)



12030
12031
12032
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12030

def get_double(name)
    Rbind::cv_bf_matcher_get_double( self, name)
end

#get_int(name) ⇒ Object

wrapper for int cv::BFMatcher::getInt(const cv::String name)



12025
12026
12027
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12025

def get_int(name)
    Rbind::cv_bf_matcher_get_int( self, name)
end

#get_mat(name) ⇒ Object

wrapper for cv::Mat cv::BFMatcher::getMat(const cv::String name)



12048
12049
12050
12051
12052
12053
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12048

def get_mat(name)
    result = Rbind::cv_bf_matcher_get_mat( self, name)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#get_mat_vector(name) ⇒ Object

wrapper for vector_Mat cv::BFMatcher::getMatVector(const cv::String name)



12056
12057
12058
12059
12060
12061
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12056

def get_mat_vector(name)
    result = Rbind::cv_bf_matcher_get_mat_vector( self, name)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#get_params(names) ⇒ Object

wrapper for void cv::BFMatcher::getParams(vector_string names)



12120
12121
12122
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12120

def get_params(names)
    Rbind::cv_bf_matcher_get_params( self, names)
end

#get_string(name) ⇒ Object

wrapper for cv::String cv::BFMatcher::getString(const cv::String name)



12040
12041
12042
12043
12044
12045
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12040

def get_string(name)
    result = Rbind::cv_bf_matcher_get_string( self, name)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#get_train_descriptorsObject

wrapper for vector_Mat cv::BFMatcher::getTrainDescriptors()



11935
11936
11937
11938
11939
11940
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11935

def get_train_descriptors()
    result = Rbind::cv_bf_matcher_get_train_descriptors( self)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#knn_match(*args) ⇒ Object

wrapper for overloaded method knn_match

Raises:

  • (ArgumentError)


11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11989

def knn_match(*args)
    # wrapper for void cv::BFMatcher::knnMatch(const cv::Mat queryDescriptors, const cv::Mat trainDescriptors, vector_vector_DMatch matches, int k, const cv::Mat mask=Mat(), bool compactResult=false)
    @@cv_bf_matcher_knn_match_defaults0 ||= [nil, nil, nil, nil, Cv::Mat.new(), false]
    if(args.size >= 4 && args.size <= 6)
        args.size.upto(5) do |i|
            args[i] = @@cv_bf_matcher_knn_match_defaults0[i]
        end
        begin
            return Rbind::cv_bf_matcher_knn_match(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for void cv::BFMatcher::knnMatch(const cv::Mat queryDescriptors, vector_vector_DMatch matches, int k, const vector_Mat masks=vector_Mat(), bool compactResult=false)
    @@cv_bf_matcher_knn_match2_defaults1 ||= [nil, nil, nil, VectorMat.new(), false]
    if(args.size >= 3 && args.size <= 5)
        args.size.upto(4) do |i|
            args[i] = @@cv_bf_matcher_knn_match2_defaults1[i]
        end
        begin
            return Rbind::cv_bf_matcher_knn_match2(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "No overloaded signature fits to: #{args.map(&:class)}"
end

#match(*args) ⇒ Object

wrapper for overloaded method match

Raises:

  • (ArgumentError)


11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11958

def match(*args)
    # wrapper for void cv::BFMatcher::match(const cv::Mat queryDescriptors, const cv::Mat trainDescriptors, vector_DMatch matches, const cv::Mat mask=Mat())
    @@cv_bf_matcher_match_defaults0 ||= [nil, nil, nil, Cv::Mat.new()]
    if(args.size >= 3 && args.size <= 4)
        args.size.upto(3) do |i|
            args[i] = @@cv_bf_matcher_match_defaults0[i]
        end
        begin
            return Rbind::cv_bf_matcher_match(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for void cv::BFMatcher::match(const cv::Mat queryDescriptors, vector_DMatch matches, const vector_Mat masks=vector_Mat())
    @@cv_bf_matcher_match2_defaults1 ||= [nil, nil, VectorMat.new()]
    if(args.size >= 2 && args.size <= 3)
        args.size.upto(2) do |i|
            args[i] = @@cv_bf_matcher_match2_defaults1[i]
        end
        begin
            return Rbind::cv_bf_matcher_match2(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "No overloaded signature fits to: #{args.map(&:class)}"
end

#param_help(name) ⇒ Object

wrapper for cv::String cv::BFMatcher::paramHelp(const cv::String name)



12107
12108
12109
12110
12111
12112
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12107

def param_help(name)
    result = Rbind::cv_bf_matcher_param_help( self, name)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#param_type(name) ⇒ Object

wrapper for int cv::BFMatcher::paramType(const cv::String name)



12115
12116
12117
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12115

def param_type(name)
    Rbind::cv_bf_matcher_param_type( self, name)
end

#set_algorithm(name, value) ⇒ Object

wrapper for void cv::BFMatcher::setAlgorithm(const cv::String name, const Ptr_Algorithm value)



12102
12103
12104
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12102

def set_algorithm(name, value)
    Rbind::cv_bf_matcher_set_algorithm( self, name, value)
end

#set_bool(name, value) ⇒ Object

wrapper for void cv::BFMatcher::setBool(const cv::String name, bool value)



12082
12083
12084
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12082

def set_bool(name, value)
    Rbind::cv_bf_matcher_set_bool( self, name, value)
end

#set_double(name, value) ⇒ Object

wrapper for void cv::BFMatcher::setDouble(const cv::String name, double value)



12077
12078
12079
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12077

def set_double(name, value)
    Rbind::cv_bf_matcher_set_double( self, name, value)
end

#set_int(name, value) ⇒ Object

wrapper for void cv::BFMatcher::setInt(const cv::String name, int value)



12072
12073
12074
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12072

def set_int(name, value)
    Rbind::cv_bf_matcher_set_int( self, name, value)
end

#set_mat(name, value) ⇒ Object

wrapper for void cv::BFMatcher::setMat(const cv::String name, const cv::Mat value)



12092
12093
12094
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12092

def set_mat(name, value)
    Rbind::cv_bf_matcher_set_mat( self, name, value)
end

#set_mat_vector(name, value) ⇒ Object

wrapper for void cv::BFMatcher::setMatVector(const cv::String name, const vector_Mat value)



12097
12098
12099
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12097

def set_mat_vector(name, value)
    Rbind::cv_bf_matcher_set_mat_vector( self, name, value)
end

#set_string(name, value) ⇒ Object

wrapper for void cv::BFMatcher::setString(const cv::String name, const cv::String value)



12087
12088
12089
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12087

def set_string(name, value)
    Rbind::cv_bf_matcher_set_string( self, name, value)
end

#trainObject

wrapper for void cv::BFMatcher::train()



11953
11954
11955
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11953

def train()
    Rbind::cv_bf_matcher_train( self)
end