Class: OpenCV::Cv::SIFT

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

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



14386
14387
14388
14389
14390
14391
14392
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14386

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



14383
14384
14385
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14383

def __obj_ptr__
  @__obj_ptr__
end

Class Method Details

._create(name) ⇒ Object

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



14572
14573
14574
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14572

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

.create(name) ⇒ Object

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



14426
14427
14428
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14426

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



14378
14379
14380
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14378

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

.get_list(algorithms) ⇒ Object

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



14567
14568
14569
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14567

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14335

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(SIFTStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for cv::SIFT::SIFT(int nfeatures=0, int nOctaveLayers=3, double contrastThreshold=0.04, double edgeThreshold=10, double sigma=1.6)
    @@cv_sift_sift_defaults0 ||= [0, 3, 0.04, 10, 1.6]
    if(args.size >= 0 && args.size <= 5)
        args.size.upto(4) do |i|
            args[i] = @@cv_sift_sift_defaults0[i]
        end
        begin
            return Rbind::cv_sift_sift(*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.



14366
14367
14368
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14366

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



14357
14358
14359
14360
14361
14362
14363
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14357

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



14372
14373
14374
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14372

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)


14397
14398
14399
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14397

def __owner__?
    @__obj_ptr__[:bowner]
end

#compute(image, keypoints, descriptors) ⇒ Object

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



14577
14578
14579
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14577

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

#descriptor_sizeObject

methods wrapper for int cv::SIFT::descriptorSize()



14411
14412
14413
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14411

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

#descriptor_typeObject

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



14416
14417
14418
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14416

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

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

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



14431
14432
14433
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14431

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

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

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



14421
14422
14423
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14421

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

#empty(*args) ⇒ Object

wrapper for overloaded method empty

Raises:

  • (ArgumentError)


14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14436

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

    # wrapper for bool cv::SIFT::empty()
    @@cv_sift_empty2_defaults1 ||= []
    if(args.size >= 0 && args.size <= 0)
        args.size.upto(-1) do |i|
            args[i] = @@cv_sift_empty2_defaults1[i]
        end
        begin
            return Rbind::cv_sift_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::SIFT::getAlgorithm(const cv::String name)



14506
14507
14508
14509
14510
14511
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14506

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



14477
14478
14479
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14477

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

#get_double(name) ⇒ Object

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



14472
14473
14474
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14472

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

#get_int(name) ⇒ Object

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



14467
14468
14469
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14467

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

#get_mat(name) ⇒ Object

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



14490
14491
14492
14493
14494
14495
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14490

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



14498
14499
14500
14501
14502
14503
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14498

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



14562
14563
14564
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14562

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

#get_string(name) ⇒ Object

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



14482
14483
14484
14485
14486
14487
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14482

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



14549
14550
14551
14552
14553
14554
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14549

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



14557
14558
14559
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14557

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

#set_algorithm(name, value) ⇒ Object

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



14544
14545
14546
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14544

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

#set_bool(name, value) ⇒ Object

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



14524
14525
14526
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14524

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

#set_double(name, value) ⇒ Object

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



14519
14520
14521
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14519

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

#set_int(name, value) ⇒ Object

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



14514
14515
14516
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14514

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

#set_mat(name, value) ⇒ Object

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



14534
14535
14536
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14534

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

#set_mat_vector(name, value) ⇒ Object

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



14539
14540
14541
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14539

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

#set_string(name, value) ⇒ Object

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



14529
14530
14531
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14529

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