Class: OpenCV::Cv::StereoSGBM

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

Constants collapse

DISP_SHIFT =
4
DISP_SCALE =
(1<<DISP_SHIFT)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ StereoSGBM

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



13100
13101
13102
13103
13104
13105
13106
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13100

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



13097
13098
13099
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13097

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



13092
13093
13094
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13092

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13036

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

    # wrapper for cv::StereoSGBM::StereoSGBM(int minDisparity, int numDisparities, int SADWindowSize, int P1=0, int P2=0, int disp12MaxDiff=0, int preFilterCap=0, int uniquenessRatio=0, int speckleWindowSize=0, int speckleRange=0, bool fullDP=false)
    @@cv_stereosgbm_stereosgbm2_defaults1 ||= [nil, nil, nil, 0, 0, 0, 0, 0, 0, 0, false]
    if(args.size >= 3 && args.size <= 11)
        args.size.upto(10) do |i|
            args[i] = @@cv_stereosgbm_stereosgbm2_defaults1[i]
        end
        begin
            return Rbind::cv_stereosgbm_stereosgbm2(*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.



13080
13081
13082
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13080

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



13071
13072
13073
13074
13075
13076
13077
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13071

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



13086
13087
13088
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13086

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)


13111
13112
13113
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13111

def __owner__?
    @__obj_ptr__[:bowner]
end

#compute(left, right, disp) ⇒ Object

wrapper for void cv::StereoSGBM::operator()(const cv::Mat left, const cv::Mat right, cv::Mat disp)



13237
13238
13239
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13237

def compute(left, right, disp)
    Rbind::cv_stereosgbm_compute( self, left, right, disp)
end

#disp12_max_diffObject

wrapper for int disp12MaxDiff



13217
13218
13219
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13217

def disp12_max_diff()
    Rbind::cv_stereosgbm_get_disp12_max_diff( self)
end

#disp12_max_diff=(value) ⇒ Object

wrapper for int disp12MaxDiff



13222
13223
13224
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13222

def disp12_max_diff=(value)
    Rbind::cv_stereosgbm_set_disp12_max_diff( self, value)
end

#fulldpObject

wrapper for bool fullDP



13227
13228
13229
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13227

def fulldp()
    Rbind::cv_stereosgbm_get_fulldp( self)
end

#fulldp=(value) ⇒ Object

wrapper for bool fullDP



13232
13233
13234
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13232

def fulldp=(value)
    Rbind::cv_stereosgbm_set_fulldp( self, value)
end

#min_disparityObject

methods wrapper for int minDisparity



13127
13128
13129
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13127

def min_disparity()
    Rbind::cv_stereosgbm_get_min_disparity( self)
end

#min_disparity=(value) ⇒ Object

wrapper for int minDisparity



13132
13133
13134
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13132

def min_disparity=(value)
    Rbind::cv_stereosgbm_set_min_disparity( self, value)
end

#number_of_disparitiesObject

wrapper for int numberOfDisparities



13137
13138
13139
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13137

def number_of_disparities()
    Rbind::cv_stereosgbm_get_number_of_disparities( self)
end

#number_of_disparities=(value) ⇒ Object

wrapper for int numberOfDisparities



13142
13143
13144
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13142

def number_of_disparities=(value)
    Rbind::cv_stereosgbm_set_number_of_disparities( self, value)
end

#p1Object

wrapper for int P1



13177
13178
13179
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13177

def p1()
    Rbind::cv_stereosgbm_get_p1( self)
end

#p1=(value) ⇒ Object

wrapper for int P1



13182
13183
13184
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13182

def p1=(value)
    Rbind::cv_stereosgbm_set_p1( self, value)
end

#p2Object

wrapper for int P2



13187
13188
13189
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13187

def p2()
    Rbind::cv_stereosgbm_get_p2( self)
end

#p2=(value) ⇒ Object

wrapper for int P2



13192
13193
13194
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13192

def p2=(value)
    Rbind::cv_stereosgbm_set_p2( self, value)
end

#pre_filter_capObject

wrapper for int preFilterCap



13157
13158
13159
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13157

def pre_filter_cap()
    Rbind::cv_stereosgbm_get_pre_filter_cap( self)
end

#pre_filter_cap=(value) ⇒ Object

wrapper for int preFilterCap



13162
13163
13164
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13162

def pre_filter_cap=(value)
    Rbind::cv_stereosgbm_set_pre_filter_cap( self, value)
end

#sad_window_sizeObject

wrapper for int SADWindowSize



13147
13148
13149
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13147

def sad_window_size()
    Rbind::cv_stereosgbm_get_sad_window_size( self)
end

#sad_window_size=(value) ⇒ Object

wrapper for int SADWindowSize



13152
13153
13154
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13152

def sad_window_size=(value)
    Rbind::cv_stereosgbm_set_sad_window_size( self, value)
end

#speckle_rangeObject

wrapper for int speckleRange



13207
13208
13209
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13207

def speckle_range()
    Rbind::cv_stereosgbm_get_speckle_range( self)
end

#speckle_range=(value) ⇒ Object

wrapper for int speckleRange



13212
13213
13214
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13212

def speckle_range=(value)
    Rbind::cv_stereosgbm_set_speckle_range( self, value)
end

#speckle_window_sizeObject

wrapper for int speckleWindowSize



13197
13198
13199
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13197

def speckle_window_size()
    Rbind::cv_stereosgbm_get_speckle_window_size( self)
end

#speckle_window_size=(value) ⇒ Object

wrapper for int speckleWindowSize



13202
13203
13204
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13202

def speckle_window_size=(value)
    Rbind::cv_stereosgbm_set_speckle_window_size( self, value)
end

#uniqueness_ratioObject

wrapper for int uniquenessRatio



13167
13168
13169
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13167

def uniqueness_ratio()
    Rbind::cv_stereosgbm_get_uniqueness_ratio( self)
end

#uniqueness_ratio=(value) ⇒ Object

wrapper for int uniquenessRatio



13172
13173
13174
# File 'lib/ruby/ropencv/ropencv_types.rb', line 13172

def uniqueness_ratio=(value)
    Rbind::cv_stereosgbm_set_uniqueness_ratio( self, value)
end