Class: OpenCV::Cv::ORB

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

Constant Summary collapse

HARRIS_SCORE =
0
FAST_SCORE =
1

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ ORB

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



9453
9454
9455
9456
9457
9458
9459
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9453

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



9450
9451
9452
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9450

def __obj_ptr__
  @__obj_ptr__
end

Class Method Details

._create(name) ⇒ Object

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



9632
9633
9634
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9632

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

.create(name) ⇒ Object

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



9486
9487
9488
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9486

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



9445
9446
9447
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9445

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

.get_list(algorithms) ⇒ Object

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



9627
9628
9629
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9627

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9402

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(ORBStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for cv::ORB::ORB(int nfeatures=500, float scaleFactor=1.2f, int nlevels=8, int edgeThreshold=31, int firstLevel=0, int WTA_K=2, int scoreType=ORB::HARRIS_SCORE, int patchSize=31)
    @@cv_orb_orb_defaults0 ||= [500, 1.2, 8, 31, 0, 2, ORB::HARRIS_SCORE, 31]
    if(args.size >= 0 && args.size <= 8)
        args.size.upto(7) do |i|
            args[i] = @@cv_orb_orb_defaults0[i]
        end
        begin
            return Rbind::cv_orb_orb(*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.



9433
9434
9435
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9433

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



9424
9425
9426
9427
9428
9429
9430
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9424

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



9439
9440
9441
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9439

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)


9464
9465
9466
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9464

def __owner__?
    @__obj_ptr__[:bowner]
end

#compute(image, keypoints, descriptors) ⇒ Object

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



9637
9638
9639
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9637

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

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

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



9491
9492
9493
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9491

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

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

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



9481
9482
9483
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9481

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

#empty(*args) ⇒ Object

wrapper for overloaded method empty

Raises:

  • (ArgumentError)


9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9496

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

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

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

#get_algorithm(name) ⇒ Object

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



9566
9567
9568
9569
9570
9571
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9566

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



9537
9538
9539
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9537

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

#get_double(name) ⇒ Object

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



9532
9533
9534
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9532

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

#get_int(name) ⇒ Object

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



9527
9528
9529
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9527

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

#get_mat(name) ⇒ Object

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



9550
9551
9552
9553
9554
9555
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9550

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



9558
9559
9560
9561
9562
9563
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9558

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



9622
9623
9624
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9622

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

#get_string(name) ⇒ Object

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



9542
9543
9544
9545
9546
9547
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9542

def get_string(name)
    result = Rbind::cv_orb_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::ORB::paramHelp(const cv::String name)



9609
9610
9611
9612
9613
9614
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9609

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



9617
9618
9619
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9617

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

#set_algorithm(name, value) ⇒ Object

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



9604
9605
9606
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9604

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

#set_bool(name, value) ⇒ Object

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



9584
9585
9586
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9584

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

#set_double(name, value) ⇒ Object

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



9579
9580
9581
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9579

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

#set_int(name, value) ⇒ Object

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



9574
9575
9576
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9574

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

#set_mat(name, value) ⇒ Object

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



9594
9595
9596
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9594

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

#set_mat_vector(name, value) ⇒ Object

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



9599
9600
9601
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9599

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

#set_string(name, value) ⇒ Object

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



9589
9590
9591
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9589

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