Class: OpenCV::CvHuMoments
- Inherits:
-
Object
- Object
- OpenCV::CvHuMoments
- Defined in:
- ext/opencv/cvhumoments.cpp,
ext/opencv/cvhumoments.cpp
Overview
Hu invariants
Instance Method Summary collapse
-
#hu1 ⇒ Number
Returns hu1 invariant.
-
#hu2 ⇒ Number
Returns hu2 invariant.
-
#hu3 ⇒ Number
Returns hu3 invariant.
-
#hu4 ⇒ Number
Returns hu4 invariant.
-
#hu5 ⇒ Number
Returns hu5 invariant.
-
#hu6 ⇒ Number
Returns hu6 invariant.
-
#hu7 ⇒ Number
Returns hu7 invariant.
-
#new(src_moments) ⇒ CvHuMoments
constructor
Calculates the seven Hu invariants.
-
#to_ary ⇒ Array<Number>
(also: #to_a)
Returns hu invaliants as an Array.
Constructor Details
#new(src_moments) ⇒ CvHuMoments
Calculates the seven Hu invariants
43 44 45 46 47 48 49 50 51 52 53 |
# File 'ext/opencv/cvhumoments.cpp', line 43
VALUE
rb_initialize(VALUE self, VALUE src_moments)
{
try {
cvGetHuMoments(CVMOMENTS(src_moments), CVHUMOMENTS(self));
}
catch (cv::Exception& e) {
raise_cverror(e);
}
return self;
}
|
Instance Method Details
#hu1 ⇒ Number
Returns hu1 invariant
60 61 62 |
# File 'ext/opencv/cvhumoments.cpp', line 60
VALUE rb_hu1(VALUE self) {
return DBL2NUM(CVHUMOMENTS(self)->hu1);
}
|
#hu2 ⇒ Number
Returns hu2 invariant
69 70 71 |
# File 'ext/opencv/cvhumoments.cpp', line 69
VALUE rb_hu2(VALUE self) {
return DBL2NUM(CVHUMOMENTS(self)->hu2);
}
|
#hu3 ⇒ Number
Returns hu3 invariant
78 79 80 |
# File 'ext/opencv/cvhumoments.cpp', line 78
VALUE rb_hu3(VALUE self) {
return DBL2NUM(CVHUMOMENTS(self)->hu3);
}
|
#hu4 ⇒ Number
Returns hu4 invariant
87 88 89 |
# File 'ext/opencv/cvhumoments.cpp', line 87
VALUE rb_hu4(VALUE self) {
return DBL2NUM(CVHUMOMENTS(self)->hu4);
}
|
#hu5 ⇒ Number
Returns hu5 invariant
96 97 98 |
# File 'ext/opencv/cvhumoments.cpp', line 96
VALUE rb_hu5(VALUE self) {
return DBL2NUM(CVHUMOMENTS(self)->hu5);
}
|
#hu6 ⇒ Number
Returns hu6 invariant
105 106 107 |
# File 'ext/opencv/cvhumoments.cpp', line 105
VALUE rb_hu6(VALUE self) {
return DBL2NUM(CVHUMOMENTS(self)->hu6);
}
|
#hu7 ⇒ Number
Returns hu7 invariant
114 115 116 |
# File 'ext/opencv/cvhumoments.cpp', line 114
VALUE rb_hu7(VALUE self) {
return DBL2NUM(CVHUMOMENTS(self)->hu7);
}
|
#to_ary ⇒ Array<Number> Also known as: to_a
Returns hu invaliants as an Array
123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'ext/opencv/cvhumoments.cpp', line 123
VALUE
rb_to_ary(VALUE self)
{
CvHuMoments *hu_moments = CVHUMOMENTS(self);
return rb_ary_new3(7,
rb_float_new(hu_moments->hu1),
rb_float_new(hu_moments->hu2),
rb_float_new(hu_moments->hu3),
rb_float_new(hu_moments->hu4),
rb_float_new(hu_moments->hu5),
rb_float_new(hu_moments->hu6),
rb_float_new(hu_moments->hu7));
}
|