@@ -128,51 +128,90 @@ def __init__(
128128 The list can be indexed, sliced or used as an iterator in a for loop
129129 or comprehension, for example:
130130
131- .. code-block:: python
131+ .. code-block:: python
132132
133- for blob in blobs:
134- # do a thing
135- areas = [blob.area for blob in blobs]
133+ for blob in blobs:
134+ # do a thing
135+
136+ areas = [blob.area for blob in blobs]
136137
137138
138139 However the last line can also be written as:
139140
140- .. code-block:: python
141+ .. code-block:: python
141142
142- areas = blobs.area
143+ areas = blobs.area
143144
144145
145146 since all methods return a scalar if applied to a single blob:
146147
147- .. code-block:: python
148+ .. code-block:: python
148149
149- blobs[1].area
150+ blobs[1].area
150151
151152
152153 or a list if applied to multiple blobs:
153154
154- .. code-block:: python
155+ .. code-block:: python
155156
156- blobs.area
157+ blobs.area
157158
158159
159160 A blob has many attributes:
160161
162+ Geometric attributes
163+
161164 .. list-table::
162165 :header-rows: 1
166+ :widths: 30 70
163167
164- * - Attribute
168+ * - Property
165169 - Description
166170 * - :meth:`area`
167171 - The area of the blob.
168- * - :meth:`u`, :meth:`v`
169- - The centroid (center of mass) of the blob.
170172 * - :meth:`bbox`
171173 - The bounding box of the blob.
172- * - :meth:`color`
173- - The value of pixels within the blob.
174+ * - :meth:`umin`, :meth:`umax`
175+ - The horizontal extent of the bounding box.
176+ * - :meth:`vmin`, :meth:`vmax`
177+ - The vertical extent of the bounding box.
174178 * - :meth:`touch`
175- - True if the blob touches the border.
179+ - True if the blob touches the border of the image.
180+ * - :meth:`fillfactor`
181+ - Ratio of blob area to bounding box area.
182+ * - :meth:`bboxarea`
183+ - Area of the bounding box.
184+
185+
186+ Moment attributes
187+
188+ .. list-table::
189+ :header-rows: 1
190+ :widths: 30 70
191+
192+ * - Property
193+ - Description
194+ * - :meth:`u`, :meth:`v`
195+ - The centroid (center of mass) of the blob.
196+ * - :meth:`orientation`
197+ - Orientation of the equivalent ellipse.
198+ * - :meth:`a, b`
199+ - The equivalent ellipse radii.
200+ * - :meth:`aligned_box`
201+ - A rotated bounding box with sides parallel to the axes of the equivalent ellipse.
202+ * - :meth:`moments`
203+ - The moments of the blob including central and normalised values up to 3rd order.
204+ * - :meth:`humoments`
205+ - Seven Hu moment invariants (invariant to position, orientation and scale).
206+
207+ Boundary and shape attributes
208+
209+ .. list-table::
210+ :header-rows: 1
211+ :widths: 30 70
212+
213+ * - Property
214+ - Description
176215 * - :meth:`contour_point`
177216 - A point on the contour of the blob.
178217 * - :meth:`perimeter`
@@ -181,18 +220,34 @@ def __init__(
181220 - The perimeter length of the blob.
182221 * - :meth:`circularity`
183222 - The circularity of the blob.
184- * - :meth:`moments`
185- - The moments of the blob including central, normalized upto 3rd order.
186- * - :meth:`orientation`
187- - Orientation of the equivalent ellipse.
188- * - :meth:`a, b`
189- - The equivalent ellipse radii.
223+ * - :meth:`perimeter_approx`
224+ - A polygonal approximation to the perimeter.
225+ * - :meth:`perimeter_hull`
226+ - The convex hull of the perimeter.
227+ * - :meth:`MEC`
228+ - The minimum enclosing circle.
229+ * - :meth:`MER`
230+ - The minimum enclosing rectangle.
231+
232+
233+ Hierarchy and region attributes
234+
235+ .. list-table::
236+ :header-rows: 1
237+ :widths: 30 70
238+
239+ * - Property
240+ - Description
241+ * - :meth:`color`
242+ - The value of pixels within the blob.
190243 * - :meth:`children`
191244 - A list of references to child :class:`Blob` instances.
192245 * - :meth:`parent`
193246 - A reference to the parent :class:`Blob` instance, or None if no parent.
194247 * - :meth:`level`
195248 - The depth of the blob in the region tree.
249+ * - :meth:`dotfile`
250+ - Write a GraphViz dot file representing the blob hierarchy.
196251
197252 .. note:: ``findContours`` can give surprising results for small images:
198253
@@ -2319,6 +2374,8 @@ def blobs(self, **kwargs) -> Blobs:
23192374
23202375 :references:
23212376 - |RVC3|, Section 12.1.2.1.
2377+
2378+ :seealso: :class:`Blobs` :class:`Blob`
23222379 """
23232380
23242381 # TODO do the feature extraction here
0 commit comments