Class: OpenCV::CvConnectedComp
- Inherits:
-
Object
- Object
- OpenCV::CvConnectedComp
- Defined in:
- ext/opencv/cvconnectedcomp.cpp,
ext/opencv/cvconnectedcomp.cpp
Overview
Connected component see CvMat#flood_fill
Instance Method Summary collapse
-
#area ⇒ Number
Returns area of connected component.
-
#contour ⇒ CvContour
Returns optional component boundary.
-
#new(area = nil, value = nil, rect = nil, contour = nil) ⇒ CvConnectedComp
constructor
Constructor.
-
#rect ⇒ CvRect
Return ROI of the segmented component.
-
#rect= ⇒ CvRect
Set ROI of the segmented component.
-
#value ⇒ CvScalar
Return average color of the connected component.
Constructor Details
#new(area = nil, value = nil, rect = nil, contour = nil) ⇒ CvConnectedComp
Constructor
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'ext/opencv/cvconnectedcomp.cpp', line 44
VALUE
rb_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE area, value, rect, contour;
rb_scan_args(argc, argv, "04", &area, &value, &rect, &contour);
if (!NIL_P(area))
CVCONNECTEDCOMP(self)->area = NUM2DBL(area);
if (!NIL_P(value))
CVCONNECTEDCOMP(self)->value = *CVSCALAR(value);
if (!NIL_P(rect))
CVCONNECTEDCOMP(self)->rect = *CVRECT(rect);
if (!NIL_P(contour))
CVCONNECTEDCOMP(self)->contour = CVSEQ(contour);
return self;
}
|
Instance Method Details
#area ⇒ Number
Returns area of connected component
66 67 68 69 70 |
# File 'ext/opencv/cvconnectedcomp.cpp', line 66
VALUE
rb_area(VALUE self)
{
return rb_float_new(CVCONNECTEDCOMP(self)->area);
}
|
#contour ⇒ CvContour
Returns optional component boundary
112 113 114 115 116 |
# File 'ext/opencv/cvconnectedcomp.cpp', line 112
VALUE
rb_contour(VALUE self)
{
return REFER_OBJECT(cCvContour::rb_class(), &CVCONNECTEDCOMP(self)->contour, self);
}
|
#rect ⇒ CvRect
Return ROI of the segmented component
88 89 90 91 92 |
# File 'ext/opencv/cvconnectedcomp.cpp', line 88
VALUE
rb_rect(VALUE self)
{
return REFER_OBJECT(cCvRect::rb_class(), &CVCONNECTEDCOMP(self)->rect, self);
}
|
#rect= ⇒ CvRect
Set ROI of the segmented component
100 101 102 103 104 105 |
# File 'ext/opencv/cvconnectedcomp.cpp', line 100
VALUE
rb_set_rect(VALUE self, VALUE rect)
{
CVCONNECTEDCOMP(self)->rect = VALUE_TO_CVRECT(rect);
return self;
}
|
#value ⇒ CvScalar
Return average color of the connected component.
77 78 79 80 81 |
# File 'ext/opencv/cvconnectedcomp.cpp', line 77
VALUE
rb_value(VALUE self)
{
return REFER_OBJECT(cCvScalar::rb_class(), &CVCONNECTEDCOMP(self)->value, self);
}
|