Class: OpenCV::Cv::CascadeClassifier

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

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



12557
12558
12559
12560
12561
12562
12563
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12557

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



12554
12555
12556
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12554

def __obj_ptr__
  @__obj_ptr__
end

Class Method Details

.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



12549
12550
12551
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12549

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12493

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

    # wrapper for cv::CascadeClassifier::CascadeClassifier(const cv::String filename)
    @@cv_cascade_classifier_cascade_classifier2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        args.size.upto(0) do |i|
            args[i] = @@cv_cascade_classifier_cascade_classifier2_defaults1[i]
        end
        begin
            return Rbind::cv_cascade_classifier_cascade_classifier2(*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.



12537
12538
12539
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12537

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



12528
12529
12530
12531
12532
12533
12534
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12528

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



12543
12544
12545
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12543

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)


12568
12569
12570
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12568

def __owner__?
    @__obj_ptr__[:bowner]
end

#detect_multi_scale(*args) ⇒ Object

wrapper for overloaded method detect_multi_scale

Raises:

  • (ArgumentError)


12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12592

def detect_multi_scale(*args)
    # wrapper for void cv::CascadeClassifier::detectMultiScale(const cv::Mat image, vector_Rect objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, const cv::Size minSize=Size(), const cv::Size maxSize=Size())
    @@cv_cascade_classifier_detect_multi_scale_defaults0 ||= [nil, nil, 1.1, 3, 0, Cv::Size.new(), Cv::Size.new()]
    if(args.size >= 2 && args.size <= 7)
        args.size.upto(6) do |i|
            args[i] = @@cv_cascade_classifier_detect_multi_scale_defaults0[i]
        end
        begin
            return Rbind::cv_cascade_classifier_detect_multi_scale(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for void cv::CascadeClassifier::detectMultiScale(const cv::Mat image, vector_Rect objects, vector_int rejectLevels, vector_double levelWeights, double scaleFactor=1.1, int minNeighbors=3, int flags=0, const cv::Size minSize=Size(), const cv::Size maxSize=Size(), bool outputRejectLevels=false)
    @@cv_cascade_classifier_detect_multi_scale2_defaults1 ||= [nil, nil, nil, nil, 1.1, 3, 0, Cv::Size.new(), Cv::Size.new(), false]
    if(args.size >= 4 && args.size <= 10)
        args.size.upto(9) do |i|
            args[i] = @@cv_cascade_classifier_detect_multi_scale2_defaults1[i]
        end
        begin
            return Rbind::cv_cascade_classifier_detect_multi_scale2(self,*args)
        rescue TypeError => e
            @error = e
        end
    end

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

#emptyObject

methods wrapper for bool cv::CascadeClassifier::empty()



12582
12583
12584
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12582

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

#load(filename) ⇒ Object

wrapper for bool cv::CascadeClassifier::load(const cv::String filename)



12587
12588
12589
# File 'lib/ruby/ropencv/ropencv_types.rb', line 12587

def load(filename)
    Rbind::cv_cascade_classifier_load( self, filename)
end