Class: OpenCV::CvSURFParams

Inherits:
Object
  • Object
show all
Defined in:
ext/opencv/cvsurfparams.cpp,
ext/opencv/cvsurfparams.cpp

Overview

C structure is here.

typedef struct CvSURFParams {
  int extended;
  double hessianThreshold;
  int nOctaves;
  int nOctaveLayers;
} CvSURFParams;

Instance Method Summary collapse

Constructor Details

#CvSURFParams.new(hessian_threshold, extended = false, n_octaves = 3, n_octave_layers = 4) ⇒ Object

Create a CvSURFParams

Parameters:

  • hessian_threshold (Number)
  • extended (Boolean) (defaults to: false)

    If true, exteneded descriptors (128 elements each), otherwise basic descriptors (64 elements each)

  • n_octaves (Integer) (defaults to: 3)

    Number of octaves to be used for extraction

  • n_octave_layers (Integer) (defaults to: 4)

    Number of layers within each octave


50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'ext/opencv/cvsurfparams.cpp', line 50

VALUE
rb_initialize(int argc, VALUE *argv, VALUE self)
{
  CvSURFParams *self_ptr = CVSURFPARAMS(self);
  VALUE h_thresh, ext, noct, noctl;
  rb_scan_args(argc, argv, "13", &h_thresh, &ext, &noct, &noctl);

  self_ptr->hessianThreshold = NUM2DBL(h_thresh);
  self_ptr->extended = NIL_P(ext) ? 0 : BOOL2INT(ext);
  self_ptr->nOctaves = NIL_P(noct) ? 3 : NUM2INT(noct);
  self_ptr->nOctaveLayers = NIL_P(noctl) ? 4 : NUM2INT(noctl);
    
  return self;
}

Instance Method Details

#extendedBoolean

Return the type of descripters

false: basic descriptors (64 elements each)
true : exteneded descriptors (128 elements each)

Returns:

  • (Boolean)

96
97
98
99
100
# File 'ext/opencv/cvsurfparams.cpp', line 96

VALUE
rb_get_extended(VALUE self)
{
  return INT2BOOL(CVSURFPARAMS(self)->extended);
}

#extended=(value) ⇒ Object

Set the type of descripters

false: basic descriptors (64 elements each)
true : exteneded descriptors (128 elements each)

109
110
111
112
113
114
# File 'ext/opencv/cvsurfparams.cpp', line 109

VALUE
rb_set_extended(VALUE self, VALUE value)
{
  CVSURFPARAMS(self)->extended = BOOL2INT(value);
  return self;
}

#hessian_thresholdNumeric

Return threshold of hessian

Returns:

  • (Numeric)

70
71
72
73
74
# File 'ext/opencv/cvsurfparams.cpp', line 70

VALUE
rb_get_hessian_threshold(VALUE self)
{
  return DBL2NUM(CVSURFPARAMS(self)->hessianThreshold);
}

#hessian_threshold=(value) ⇒ Object

Set threshold of hessian to value


82
83
84
85
86
87
# File 'ext/opencv/cvsurfparams.cpp', line 82

VALUE
rb_set_hessian_threshold(VALUE self, VALUE value)
{
  CVSURFPARAMS(self)->hessianThreshold = NUM2DBL(value);
  return self;
}

#n_octave_layersFixnum

Return the number of layers within each octave

Returns:

  • (Fixnum)

144
145
146
147
148
# File 'ext/opencv/cvsurfparams.cpp', line 144

VALUE
rb_get_n_octave_layers(VALUE self)
{
  return INT2NUM(CVSURFPARAMS(self)->nOctaveLayers);
}

#n_octave_layers=(value) ⇒ Object

Set the number of layers within each octave


155
156
157
158
159
160
# File 'ext/opencv/cvsurfparams.cpp', line 155

VALUE
rb_set_n_octave_layers(VALUE self, VALUE value)
{
  CVSURFPARAMS(self)->nOctaveLayers = NUM2INT(value);
  return self;
}

#n_octavesFixnum

Return the number of octaves to be used for extraction

Returns:

  • (Fixnum)

121
122
123
124
125
# File 'ext/opencv/cvsurfparams.cpp', line 121

VALUE
rb_get_n_octaves(VALUE self)
{
  return INT2NUM(CVSURFPARAMS(self)->nOctaves);
}

#n_octaves=(value) ⇒ Object

Set the number of octaves to be used for extraction


132
133
134
135
136
137
# File 'ext/opencv/cvsurfparams.cpp', line 132

VALUE
rb_set_n_octaves(VALUE self, VALUE value)
{
  CVSURFPARAMS(self)->nOctaves = NUM2INT(value);
  return self;
}