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)


10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
# File 'lib/ropencv/ropencv_types.rb', line 10705

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_match__2_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_match__2_defaults1[i]
        end
        begin
                return Rbind::cv_d_match_d_match__2(*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_match__3_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_match__3_defaults2[i]
        end
        begin
                return Rbind::cv_d_match_d_match__3(*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



10689
10690
10691
# File 'lib/ropencv/ropencv_types.rb', line 10689

def self.null
    new(DMatchStruct.new)
end

Instance Method Details

#distanceFloat Also known as: get_distance

Note:

method wrapper for float distance

Returns:

  • (Float)


10881
10882
10883
10884
# File 'lib/ropencv/ropencv_types.rb', line 10881

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)


10890
10891
10892
10893
# File 'lib/ropencv/ropencv_types.rb', line 10890

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)


10864
10865
10866
10867
# File 'lib/ropencv/ropencv_types.rb', line 10864

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)


10873
10874
10875
10876
# File 'lib/ropencv/ropencv_types.rb', line 10873

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)


10830
10831
10832
10833
# File 'lib/ropencv/ropencv_types.rb', line 10830

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)


10839
10840
10841
10842
# File 'lib/ropencv/ropencv_types.rb', line 10839

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



10819
10820
10821
# File 'lib/ropencv/ropencv_types.rb', line 10819

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)


10847
10848
10849
10850
# File 'lib/ropencv/ropencv_types.rb', line 10847

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)


10856
10857
10858
10859
# File 'lib/ropencv/ropencv_types.rb', line 10856

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