Module: OpenCV::Curve
- Defined in:
- ext/opencv/curve.cpp,
ext/opencv/cvchain.cpp,
ext/opencv/cvcontour.cpp
Instance Method Summary collapse
-
#arc_length(slice = nil, is_closed = nil) ⇒ Number
Calculates length of a curve.
-
#closed? ⇒ Boolean
If the curve is closed, return true.
-
#convex? ⇒ Boolean
If the curve is convex, return true.
-
#hole? ⇒ Boolean
If the curve is hole(inner contour), return true.
-
#simple? ⇒ Boolean
If the curve is simple, return true.
Instance Method Details
#arc_length(slice = nil, is_closed = nil) ⇒ Number
Calculates length of a curve
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'ext/opencv/curve.cpp', line 88
VALUE
rb_arc_length(int argc, VALUE *argv, VALUE self)
{
VALUE slice, is_closed;
rb_scan_args(argc, argv, "02", &slice, &is_closed);
double length = 0;
try {
length = cvArcLength(CVARR(self),
NIL_P(slice) ? CV_WHOLE_SEQ : VALUE_TO_CVSLICE(slice),
TRUE_OR_FALSE(is_closed, -1));
}
catch (cv::Exception& e) {
raise_cverror(e);
}
return rb_float_new(length);
}
|
#closed? ⇒ Boolean
If the curve is closed, return true. Otherwise return false.
33 34 35 36 37 |
# File 'ext/opencv/curve.cpp', line 33
VALUE
rb_closed_q(VALUE self)
{
return CV_IS_SEQ_CLOSED(CVSEQ(self)) ? Qtrue : Qfalse;
}
|
#convex? ⇒ Boolean
If the curve is convex, return true. Otherwise return false.
45 46 47 48 49 |
# File 'ext/opencv/curve.cpp', line 45
VALUE
rb_convex_q(VALUE self)
{
return CV_IS_SEQ_CONVEX(CVSEQ(self)) ? Qtrue : Qfalse;
}
|
#hole? ⇒ Boolean
If the curve is hole(inner contour), return true. Otherwise return false.
57 58 59 60 61 |
# File 'ext/opencv/curve.cpp', line 57
VALUE
rb_hole_q(VALUE self)
{
return CV_IS_SEQ_HOLE(CVSEQ(self)) ? Qtrue : Qfalse;
}
|
#simple? ⇒ Boolean
If the curve is simple, return true. Otherwise return false.
69 70 71 72 73 |
# File 'ext/opencv/curve.cpp', line 69
VALUE
rb_simple_q(VALUE self)
{
return CV_IS_SEQ_SIMPLE(CVSEQ(self)) ? Qtrue : Qfalse;
}
|