Class: OpenCV::Cv::MSER

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

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



9731
9732
9733
9734
9735
9736
9737
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9731

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



9728
9729
9730
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9728

def __obj_ptr__
  @__obj_ptr__
end

Class Method Details

._create(name) ⇒ Object

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



9902
9903
9904
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9902

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

.create(detector_type) ⇒ Object

wrapper for Ptr_FeatureDetector cv::MSER::create(const cv::String detectorType)



9792
9793
9794
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9792

def self.create(detector_type)
    Rbind::cv_mser_create(detector_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



9723
9724
9725
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9723

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

.get_list(algorithms) ⇒ Object

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



9897
9898
9899
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9897

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9680

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(MSERStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for cv::MSER::MSER(int _delta=5, int _min_area=60, int _max_area=14400, double _max_variation=0.25, double _min_diversity=.2, int _max_evolution=200, double _area_threshold=1.01, double _min_margin=0.003, int _edge_blur_size=5)
    @@cv_mser_mser_defaults0 ||= [5, 60, 14400, 0.25, 0.2, 200, 1.01, 0.003, 5]
    if(args.size >= 0 && args.size <= 9)
        args.size.upto(8) do |i|
            args[i] = @@cv_mser_mser_defaults0[i]
        end
        begin
            return Rbind::cv_mser_mser(*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.



9711
9712
9713
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9711

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



9702
9703
9704
9705
9706
9707
9708
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9702

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



9717
9718
9719
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9717

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)


9742
9743
9744
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9742

def __owner__?
    @__obj_ptr__[:bowner]
end

#detect(*args) ⇒ Object

methods wrapper for overloaded method detect

Raises:

  • (ArgumentError)


9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9756

def detect(*args)
    # wrapper for void cv::MSER::operator()(const cv::Mat image, vector_vector_Point msers, const cv::Mat mask=Mat())
    @@cv_mser_detect_defaults0 ||= [nil, nil, Cv::Mat.new()]
    if(args.size >= 2 && args.size <= 3)
        args.size.upto(2) do |i|
            args[i] = @@cv_mser_detect_defaults0[i]
        end
        begin
            return Rbind::cv_mser_detect(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for void cv::MSER::detect(const cv::Mat image, vector_KeyPoint keypoints, const cv::Mat mask=Mat())
    @@cv_mser_detect1_defaults0 ||= [nil, nil, Cv::Mat.new()]
    if(args.size >= 2 && args.size <= 3)
        args.size.upto(2) do |i|
            args[i] = @@cv_mser_detect1_defaults0[i]
        end
        begin
            return Rbind::cv_mser_detect1(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

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

#emptyObject

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



9787
9788
9789
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9787

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

#get_algorithm(name) ⇒ Object

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



9836
9837
9838
9839
9840
9841
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9836

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



9807
9808
9809
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9807

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

#get_double(name) ⇒ Object

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



9802
9803
9804
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9802

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

#get_int(name) ⇒ Object

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



9797
9798
9799
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9797

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

#get_mat(name) ⇒ Object

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



9820
9821
9822
9823
9824
9825
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9820

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



9828
9829
9830
9831
9832
9833
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9828

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



9892
9893
9894
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9892

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

#get_string(name) ⇒ Object

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



9812
9813
9814
9815
9816
9817
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9812

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

#param_help(name) ⇒ Object

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



9879
9880
9881
9882
9883
9884
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9879

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



9887
9888
9889
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9887

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

#set_algorithm(name, value) ⇒ Object

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



9874
9875
9876
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9874

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

#set_bool(name, value) ⇒ Object

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



9854
9855
9856
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9854

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

#set_double(name, value) ⇒ Object

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



9849
9850
9851
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9849

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

#set_int(name, value) ⇒ Object

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



9844
9845
9846
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9844

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

#set_mat(name, value) ⇒ Object

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



9864
9865
9866
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9864

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

#set_mat_vector(name, value) ⇒ Object

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



9869
9870
9871
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9869

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

#set_string(name, value) ⇒ Object

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



9859
9860
9861
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9859

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