Class: OpenCV::Cv::BRISK

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

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



9186
9187
9188
9189
9190
9191
9192
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9186

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



9183
9184
9185
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9183

def __obj_ptr__
  @__obj_ptr__
end

Class Method Details

._create(name) ⇒ Object

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



9367
9368
9369
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9367

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

.create(name) ⇒ Object

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



9221
9222
9223
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9221

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



9178
9179
9180
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9178

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

.get_list(algorithms) ⇒ Object

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



9362
9363
9364
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9362

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9122

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(BRISKStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for cv::BRISK::BRISK(int thresh=30, int octaves=3, float patternScale=1.0f)
    @@cv_brisk_brisk_defaults0 ||= [30, 3, 1.0]
    if(args.size >= 0 && args.size <= 3)
        args.size.upto(2) do |i|
            args[i] = @@cv_brisk_brisk_defaults0[i]
        end
        begin
            return Rbind::cv_brisk_brisk(*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for cv::BRISK::BRISK(vector_float radiusList, vector_int numberList, float dMax=5.85f, float dMin=8.2f, const vector_int indexChange=vector_int())
    @@cv_brisk_brisk2_defaults1 ||= [nil, nil, 5.85, 8.2, VectorInt.new()]
    if(args.size >= 2 && args.size <= 5)
        args.size.upto(4) do |i|
            args[i] = @@cv_brisk_brisk2_defaults1[i]
        end
        begin
            return Rbind::cv_brisk_brisk2(*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.



9166
9167
9168
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9166

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



9157
9158
9159
9160
9161
9162
9163
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9157

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



9172
9173
9174
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9172

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)


9197
9198
9199
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9197

def __owner__?
    @__obj_ptr__[:bowner]
end

#compute(image, keypoints, descriptors) ⇒ Object

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



9372
9373
9374
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9372

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

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

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



9226
9227
9228
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9226

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

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

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



9216
9217
9218
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9216

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

#empty(*args) ⇒ Object

wrapper for overloaded method empty

Raises:

  • (ArgumentError)


9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9231

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

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

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

#generate_kernel(radius_list, number_list, d_max = 5.85, d_min = 8.2, index_change = VectorInt.new()) ⇒ Object

methods wrapper for void cv::BRISK::generateKernel(vector_float radiusList, vector_int numberList, float dMax=5.85f, float dMin=8.2f, const vector_int indexChange=vector_int())



9211
9212
9213
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9211

def generate_kernel(radius_list, number_list, d_max = 5.85, d_min = 8.2, index_change = VectorInt.new())
    Rbind::cv_brisk_generate_kernel( self, radius_list, number_list, d_max, d_min, index_change)
end

#get_algorithm(name) ⇒ Object

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



9301
9302
9303
9304
9305
9306
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9301

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



9272
9273
9274
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9272

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

#get_double(name) ⇒ Object

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



9267
9268
9269
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9267

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

#get_int(name) ⇒ Object

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



9262
9263
9264
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9262

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

#get_mat(name) ⇒ Object

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



9285
9286
9287
9288
9289
9290
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9285

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



9293
9294
9295
9296
9297
9298
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9293

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



9357
9358
9359
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9357

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

#get_string(name) ⇒ Object

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



9277
9278
9279
9280
9281
9282
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9277

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



9344
9345
9346
9347
9348
9349
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9344

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



9352
9353
9354
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9352

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

#set_algorithm(name, value) ⇒ Object

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



9339
9340
9341
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9339

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

#set_bool(name, value) ⇒ Object

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



9319
9320
9321
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9319

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

#set_double(name, value) ⇒ Object

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



9314
9315
9316
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9314

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

#set_int(name, value) ⇒ Object

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



9309
9310
9311
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9309

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

#set_mat(name, value) ⇒ Object

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



9329
9330
9331
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9329

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

#set_mat_vector(name, value) ⇒ Object

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



9334
9335
9336
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9334

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

#set_string(name, value) ⇒ Object

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



9324
9325
9326
# File 'lib/ruby/ropencv/ropencv_types.rb', line 9324

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