Class: OpenCV::Cv::SURF

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) ⇒ SURF

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 SURF.



14671
14672
14673
14674
14675
14676
14677
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14671

def initialize(ptr)
    @__obj_ptr__ = if ptr.is_a? SURFStruct
                       ptr
                   else
                       SURFStruct.new(FFI::AutoPointer.new(ptr,SURFStruct.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.



14668
14669
14670
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14668

def __obj_ptr__
  @__obj_ptr__
end

Class Method Details

._create(name) ⇒ Object

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



14907
14908
14909
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14907

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

.create(name) ⇒ Object

wrapper for Ptr_Feature2D cv::SURF::create(const cv::String name)



14761
14762
14763
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14761

def self.create(name)
    Rbind::cv_surf_create(name)
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



14663
14664
14665
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14663

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

.get_list(algorithms) ⇒ Object

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



14902
14903
14904
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14902

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14607

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(SURFStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for cv::SURF::SURF()
    @@cv_surf_surf_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        args.size.upto(-1) do |i|
            args[i] = @@cv_surf_surf_defaults0[i]
        end
        begin
            return Rbind::cv_surf_surf(*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for cv::SURF::SURF(double hessianThreshold, int nOctaves=4, int nOctaveLayers=2, bool extended=true, bool upright=false)
    @@cv_surf_surf2_defaults1 ||= [nil, 4, 2, true, false]
    if(args.size >= 1 && args.size <= 5)
        args.size.upto(4) do |i|
            args[i] = @@cv_surf_surf2_defaults1[i]
        end
        begin
            return Rbind::cv_surf_surf2(*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.



14651
14652
14653
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14651

def self.rbind_from_native(ptr,context)
    SURF.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.



14642
14643
14644
14645
14646
14647
14648
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14642

def self.rbind_to_native(obj,context)
    if obj.is_a? SURF
        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



14657
14658
14659
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14657

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)


14682
14683
14684
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14682

def __owner__?
    @__obj_ptr__[:bowner]
end

#compute(image, keypoints, descriptors) ⇒ Object

wrapper for void cv::SURF::compute(const cv::Mat image, vector_KeyPoint keypoints, cv::Mat descriptors)



14912
14913
14914
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14912

def compute(image, keypoints, descriptors)
    Rbind::cv_surf_compute( self, image, keypoints, descriptors)
end

#descriptor_sizeObject

wrapper for int cv::SURF::descriptorSize()



14746
14747
14748
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14746

def descriptor_size()
    Rbind::cv_surf_descriptor_size( self)
end

#descriptor_typeObject

wrapper for int cv::SURF::descriptorType()



14751
14752
14753
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14751

def descriptor_type()
    Rbind::cv_surf_descriptor_type( self)
end

#detect(image, keypoints, mask = Cv::Mat.new()) ⇒ Object

wrapper for void cv::SURF::detect(const cv::Mat image, vector_KeyPoint keypoints, const cv::Mat mask=Mat())



14766
14767
14768
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14766

def detect(image, keypoints, mask = Cv::Mat.new())
    Rbind::cv_surf_detect( self, image, keypoints, mask)
end

#detect_and_compute(image, mask, keypoints, descriptors, use_provided_keypoints = false) ⇒ Object

wrapper for void cv::SURF::operator()(const cv::Mat image, const cv::Mat mask, vector_KeyPoint keypoints, cv::Mat descriptors, bool useProvidedKeypoints=false)



14756
14757
14758
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14756

def detect_and_compute(image, mask, keypoints, descriptors, use_provided_keypoints = false)
    Rbind::cv_surf_detect_and_compute( self, image, mask, keypoints, descriptors, use_provided_keypoints)
end

#empty(*args) ⇒ Object

wrapper for overloaded method empty

Raises:

  • (ArgumentError)


14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14771

def empty(*args)
    # wrapper for bool cv::SURF::empty()
    @@cv_surf_empty_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        args.size.upto(-1) do |i|
            args[i] = @@cv_surf_empty_defaults0[i]
        end
        begin
            return Rbind::cv_surf_empty(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for bool cv::SURF::empty()
    @@cv_surf_empty2_defaults1 ||= []
    if(args.size >= 0 && args.size <= 0)
        args.size.upto(-1) do |i|
            args[i] = @@cv_surf_empty2_defaults1[i]
        end
        begin
            return Rbind::cv_surf_empty2(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

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

#extendedObject

wrapper for bool extended



14726
14727
14728
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14726

def extended()
    Rbind::cv_surf_get_extended( self)
end

#extended=(value) ⇒ Object

wrapper for bool extended



14731
14732
14733
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14731

def extended=(value)
    Rbind::cv_surf_set_extended( self, value)
end

#get_algorithm(name) ⇒ Object

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



14841
14842
14843
14844
14845
14846
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14841

def get_algorithm(name)
    result = Rbind::cv_surf_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::SURF::getBool(const cv::String name)



14812
14813
14814
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14812

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

#get_double(name) ⇒ Object

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



14807
14808
14809
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14807

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

#get_int(name) ⇒ Object

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



14802
14803
14804
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14802

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

#get_mat(name) ⇒ Object

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



14825
14826
14827
14828
14829
14830
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14825

def get_mat(name)
    result = Rbind::cv_surf_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::SURF::getMatVector(const cv::String name)



14833
14834
14835
14836
14837
14838
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14833

def get_mat_vector(name)
    result = Rbind::cv_surf_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::SURF::getParams(vector_string names)



14897
14898
14899
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14897

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

#get_string(name) ⇒ Object

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



14817
14818
14819
14820
14821
14822
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14817

def get_string(name)
    result = Rbind::cv_surf_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

#hessian_thresholdObject

methods wrapper for double hessianThreshold



14696
14697
14698
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14696

def hessian_threshold()
    Rbind::cv_surf_get_hessian_threshold( self)
end

#hessian_threshold=(value) ⇒ Object

wrapper for double hessianThreshold



14701
14702
14703
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14701

def hessian_threshold=(value)
    Rbind::cv_surf_set_hessian_threshold( self, value)
end

#n_octave_layersObject

wrapper for int nOctaveLayers



14716
14717
14718
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14716

def n_octave_layers()
    Rbind::cv_surf_getn_octave_layers( self)
end

#n_octave_layers=(value) ⇒ Object

wrapper for int nOctaveLayers



14721
14722
14723
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14721

def n_octave_layers=(value)
    Rbind::cv_surf_setn_octave_layers( self, value)
end

#n_octavesObject

wrapper for int nOctaves



14706
14707
14708
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14706

def n_octaves()
    Rbind::cv_surf_getn_octaves( self)
end

#n_octaves=(value) ⇒ Object

wrapper for int nOctaves



14711
14712
14713
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14711

def n_octaves=(value)
    Rbind::cv_surf_setn_octaves( self, value)
end

#param_help(name) ⇒ Object

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



14884
14885
14886
14887
14888
14889
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14884

def param_help(name)
    result = Rbind::cv_surf_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::SURF::paramType(const cv::String name)



14892
14893
14894
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14892

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

#set_algorithm(name, value) ⇒ Object

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



14879
14880
14881
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14879

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

#set_bool(name, value) ⇒ Object

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



14859
14860
14861
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14859

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

#set_double(name, value) ⇒ Object

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



14854
14855
14856
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14854

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

#set_int(name, value) ⇒ Object

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



14849
14850
14851
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14849

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

#set_mat(name, value) ⇒ Object

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



14869
14870
14871
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14869

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

#set_mat_vector(name, value) ⇒ Object

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



14874
14875
14876
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14874

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

#set_string(name, value) ⇒ Object

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



14864
14865
14866
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14864

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

#uprightObject

wrapper for bool upright



14736
14737
14738
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14736

def upright()
    Rbind::cv_surf_get_upright( self)
end

#upright=(value) ⇒ Object

wrapper for bool upright



14741
14742
14743
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14741

def upright=(value)
    Rbind::cv_surf_set_upright( self, value)
end