Class: OpenCV::Cv::DMatch

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.d_matchObject .d_match(_query_idx, _train_idx, _distance) ⇒ Object .d_match(_query_idx, _train_idx, _img_idx, _distance) ⇒ Object

Overloads:

  • .d_match(_query_idx, _train_idx, _distance) ⇒ Object

    Parameters:

    • _query_idx (Fixnum)
    • _train_idx (Fixnum)
    • _distance (Float)
  • .d_match(_query_idx, _train_idx, _img_idx, _distance) ⇒ Object

    Parameters:

    • _query_idx (Fixnum)
    • _train_idx (Fixnum)
    • _img_idx (Fixnum)
    • _distance (Float)

Raises:

  • (ArgumentError)


24898
24899
24900
24901
24902
24903
24904
24905
24906
24907
24908
24909
24910
24911
24912
24913
24914
24915
24916
24917
24918
24919
24920
24921
24922
24923
24924
24925
24926
24927
24928
24929
24930
24931
24932
24933
24934
24935
24936
24937
24938
24939
24940
24941
24942
24943
24944
24945
24946
# File 'lib/ropencv/ropencv_types.rb', line 24898

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(DMatchStruct)
        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::DMatch::DMatch()
    @@cv_d_match_d_match_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        targs = args.clone
        targs.size.upto(-1) do |i|
            targs[i] = @@cv_d_match_d_match_defaults0[i]
        end
        begin
                return Rbind::cv_d_match_d_match(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for cv::DMatch::DMatch(int _queryIdx, int _trainIdx, float _distance)
    @@cv_d_match_d_match2_defaults1 ||= [nil, nil, nil]
    if(args.size >= 3 && args.size <= 3)
        targs = args.clone
        targs.size.upto(2) do |i|
            targs[i] = @@cv_d_match_d_match2_defaults1[i]
        end
        begin
                return Rbind::cv_d_match_d_match2(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for cv::DMatch::DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance)
    @@cv_d_match_d_match3_defaults2 ||= [nil, nil, nil, nil]
    if(args.size >= 4 && args.size <= 4)
        targs = args.clone
        targs.size.upto(3) do |i|
            targs[i] = @@cv_d_match_d_match3_defaults2[i]
        end
        begin
                return Rbind::cv_d_match_d_match3(*targs)
        rescue TypeError => e
            @error = e
        end
    end

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

.nullObject

returns a null pointer to the object



24882
24883
24884
# File 'lib/ropencv/ropencv_types.rb', line 24882

def self.null
    new(DMatchStruct.new)
end

Instance Method Details

#distanceFloat Also known as: get_distance

Note:

method wrapper for float distance

Returns:

  • (Float)


25074
25075
25076
25077
# File 'lib/ropencv/ropencv_types.rb', line 25074

def distance()
    __validate_pointer__
    Rbind::cv_d_match_get_distance( self)
end

#distance=(value) ⇒ Void Also known as: set_distance

Note:

method wrapper for float distance

Parameters:

  • value (Float)

Returns:

  • (Void)


25083
25084
25085
25086
# File 'lib/ropencv/ropencv_types.rb', line 25083

def distance=(value)
    __validate_pointer__
    Rbind::cv_d_match_set_distance( self, value)
end

#img_idxFixnum Also known as: get_imgIdx

Note:

method wrapper for int imgIdx

Returns:

  • (Fixnum)


25057
25058
25059
25060
# File 'lib/ropencv/ropencv_types.rb', line 25057

def img_idx()
    __validate_pointer__
    Rbind::cv_d_match_get_img_idx( self)
end

#img_idx=(value) ⇒ Void Also known as: set_imgIdx

Note:

method wrapper for int imgIdx

Parameters:

  • value (Fixnum)

Returns:

  • (Void)


25066
25067
25068
25069
# File 'lib/ropencv/ropencv_types.rb', line 25066

def img_idx=(value)
    __validate_pointer__
    Rbind::cv_d_match_set_img_idx( self, value)
end

#query_idxFixnum Also known as: get_queryIdx

Note:

method wrapper for int queryIdx

methods

Returns:

  • (Fixnum)


25023
25024
25025
25026
# File 'lib/ropencv/ropencv_types.rb', line 25023

def query_idx()
    __validate_pointer__
    Rbind::cv_d_match_get_query_idx( self)
end

#query_idx=(value) ⇒ Void Also known as: set_queryIdx

Note:

method wrapper for int queryIdx

Parameters:

  • value (Fixnum)

Returns:

  • (Void)


25032
25033
25034
25035
# File 'lib/ropencv/ropencv_types.rb', line 25032

def query_idx=(value)
    __validate_pointer__
    Rbind::cv_d_match_set_query_idx( self, value)
end

#to_sObject

converts DMatch into a string by crawling through all its attributes



25012
25013
25014
# File 'lib/ropencv/ropencv_types.rb', line 25012

def to_s
    "#<cv::DMatch query_idx=#{self.query_idx} train_idx=#{self.train_idx} img_idx=#{self.img_idx} distance=#{self.distance}>"
end

#train_idxFixnum Also known as: get_trainIdx

Note:

method wrapper for int trainIdx

Returns:

  • (Fixnum)


25040
25041
25042
25043
# File 'lib/ropencv/ropencv_types.rb', line 25040

def train_idx()
    __validate_pointer__
    Rbind::cv_d_match_get_train_idx( self)
end

#train_idx=(value) ⇒ Void Also known as: set_trainIdx

Note:

method wrapper for int trainIdx

Parameters:

  • value (Fixnum)

Returns:

  • (Void)


25049
25050
25051
25052
# File 'lib/ropencv/ropencv_types.rb', line 25049

def train_idx=(value)
    __validate_pointer__
    Rbind::cv_d_match_set_train_idx( self, value)
end