Class: CVFFI::STAR::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/opencv-ffi-wrappers/features2d/star.rb

Constant Summary collapse

DEFAULTS =
{ maxSize: 45,
responseThreshold: 30,
lineThresholdProjected: 10,
lineThresholdBinarized: 8,
suppressNonmaxSize: 5 }

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Params

Returns a new instance of Params.



80
81
82
83
84
85
86
# File 'lib/opencv-ffi-wrappers/features2d/star.rb', line 80

def initialize( opts = {} )

  @params = {}
  DEFAULTS.each_key { |k|
    @params[k] = (opts[k] or DEFAULTS[k])
  }
end

Instance Method Details

#to_CvStarDetectorParamsObject



88
89
90
91
92
93
# File 'lib/opencv-ffi-wrappers/features2d/star.rb', line 88

def to_CvStarDetectorParams
  par = @params
  par.delete_if { |k,v| DEFAULTS.keys.include? k == false }
  p par
  CVFFI::CvStarDetectorParams.new( par )
end

#to_hashObject



95
96
97
# File 'lib/opencv-ffi-wrappers/features2d/star.rb', line 95

def to_hash
  @params
end