#include <stepblob.h>
Definition at line 37 of file stepblob.h.
◆ C_BLOB() [1/3]
◆ C_BLOB() [2/3]
C_BLOB::C_BLOB |
( |
C_OUTLINE_LIST * |
outline_list | ) |
|
|
explicit |
Definition at line 165 of file stepblob.cpp.
166 for (C_OUTLINE_IT ol_it(outline_list); !ol_it.empty(); ol_it.forward()) {
169 position_outline(outline, &outlines);
void CheckInverseFlagAndDirection()
◆ C_BLOB() [3/3]
Definition at line 176 of file stepblob.cpp.
177 C_OUTLINE_IT it(&outlines);
178 it.add_to_end(outline);
◆ area()
Definition at line 275 of file stepblob.cpp.
277 C_OUTLINE_IT it = &outlines;
281 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
282 outline = it.data ();
283 total += outline->
area ();
◆ bounding_box()
TBOX C_BLOB::bounding_box |
( |
| ) |
const |
Definition at line 255 of file stepblob.cpp.
258 C_OUTLINE_IT it =
const_cast<C_OUTLINE_LIST*
>(&outlines);
261 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
262 outline = it.data ();
const TBOX & bounding_box() const
◆ CheckInverseFlagAndDirection()
void C_BLOB::CheckInverseFlagAndDirection |
( |
| ) |
|
Definition at line 226 of file stepblob.cpp.
227 C_OUTLINE_IT ol_it(&outlines);
228 for (ol_it.mark_cycle_pt(); !ol_it.cycled_list(); ol_it.forward()) {
232 reverse_outline_list(outline->
child());
int16_t turn_direction() const
void set_flag(C_OUTLINE_FLAGS mask, bool value)
◆ ComputeEdgeOffsets()
void C_BLOB::ComputeEdgeOffsets |
( |
int |
threshold, |
|
|
Pix * |
pix |
|
) |
| |
Definition at line 415 of file stepblob.cpp.
416 ComputeEdgeOffsetsOutlineList(threshold, pix, &outlines);
◆ ConstructBlobsFromOutlines()
void C_BLOB::ConstructBlobsFromOutlines |
( |
bool |
good_blob, |
|
|
C_OUTLINE_LIST * |
outline_list, |
|
|
C_BLOB_IT * |
good_blobs_it, |
|
|
C_BLOB_IT * |
bad_blobs_it |
|
) |
| |
|
static |
Definition at line 191 of file stepblob.cpp.
196 C_OUTLINE_LIST nested_outlines;
197 for (C_OUTLINE_IT ol_it(outline_list); !ol_it.empty(); ol_it.forward()) {
200 position_outline(outline, &nested_outlines);
203 for (C_OUTLINE_IT ol_it(&nested_outlines); !ol_it.empty(); ol_it.forward()) {
205 bool blob_is_good = good_blob;
209 blob_is_good =
false;
210 ol_it.add_list_after(outline->
child());
216 if (!blob_is_good && bad_blobs_it !=
nullptr)
217 bad_blobs_it->add_after_then_move(blob);
219 good_blobs_it->add_after_then_move(blob);
bool IsLegallyNested() const
void CheckInverseFlagAndDirection()
◆ count_transitions()
int32_t C_BLOB::count_transitions |
( |
int32_t |
threshold | ) |
|
Definition at line 335 of file stepblob.cpp.
339 C_OUTLINE_IT it = &outlines;
343 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
344 outline = it.data ();
int32_t count_transitions(int32_t threshold)
◆ deep_copy()
◆ EstimateBaselinePosition()
int16_t C_BLOB::EstimateBaselinePosition |
( |
| ) |
|
Definition at line 433 of file stepblob.cpp.
435 int left = box.
left();
436 int width = box.
width();
437 int bottom = box.
bottom();
443 C_OUTLINE_IT it(&outlines);
444 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
447 for (
int s = 0; s < outline->
pathlength(); ++s) {
448 if (pos.
y() < y_mins[pos.
x() - left])
449 y_mins[pos.
x() - left] = pos.
y();
450 pos += outline->
step(s);
454 int bottom_extent = 0;
455 for (
int x = 0; x <= width; ++x) {
456 if (y_mins[x] == bottom || y_mins[x] == bottom + 1)
460 int best_min = box.
top();
462 int prev_y = box.
top();
463 int prev_prev_y = box.
top();
464 for (
int x = 0; x < width; x += prev_run) {
466 int y_at_x = y_mins[x];
468 while (x + run <= width && y_mins[x + run] == y_at_x) ++run;
469 if (y_at_x > bottom + 1) {
473 while (x + total_run <= width &&
474 (y_mins[x + total_run] == y_at_x ||
475 y_mins[x + total_run] == y_at_x + 1)) ++total_run;
477 if (prev_prev_y > y_at_x + 1 || x + total_run > width ||
478 y_mins[x + total_run] > y_at_x + 1) {
481 if (prev_run > 0 && prev_y == y_at_x + 1) total_run += prev_run;
482 if (total_run > bottom_extent && y_at_x < best_min) {
488 prev_prev_y = prev_y;
491 return best_min == box.
top() ? bottom : best_min;
const double kMaxPerimeterWidthRatio
int16_t y() const
access_function
const ICOORD & start_pos() const
int16_t x() const
access function
void init_to_size(int size, const T &t)
int32_t pathlength() const
TBOX bounding_box() const
ICOORD step(int index) const
◆ FakeBlob()
Definition at line 243 of file stepblob.cpp.
244 C_OUTLINE_LIST outlines;
246 return new C_BLOB(&outlines);
static void FakeOutline(const TBOX &box, C_OUTLINE_LIST *outlines)
◆ move()
void C_BLOB::move |
( |
const ICOORD |
vec | ) |
|
Definition at line 357 of file stepblob.cpp.
360 C_OUTLINE_IT it(&outlines);
362 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ())
363 it.data ()->move (vec);
◆ operator=()
Definition at line 112 of file stepblob.h.
113 if (!outlines.empty ())
static C_OUTLINE * deep_copy(const C_OUTLINE *src)
◆ out_list()
C_OUTLINE_LIST* C_BLOB::out_list |
( |
| ) |
|
|
inline |
◆ outer_area()
int32_t C_BLOB::outer_area |
( |
| ) |
|
Definition at line 314 of file stepblob.cpp.
316 C_OUTLINE_IT it = &outlines;
320 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
321 outline = it.data ();
int32_t outer_area() const
◆ perimeter()
int32_t C_BLOB::perimeter |
( |
| ) |
|
Definition at line 294 of file stepblob.cpp.
296 C_OUTLINE_IT it = &outlines;
300 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
int32_t perimeter() const
◆ plot()
Definition at line 538 of file stepblob.cpp.
541 plot_outline_list(&outlines, window, blob_colour, child_colour);
◆ plot_normed()
Definition at line 546 of file stepblob.cpp.
550 plot_normed_outline_list(denorm, &outlines, blob_colour, child_colour,
◆ render()
Definition at line 515 of file stepblob.cpp.
517 Pix* pix = pixCreate(box.
width(), box.
height(), 1);
518 render_outline_list(&outlines, box.
left(), box.
top(), pix);
TBOX bounding_box() const
◆ render_outline()
Pix * C_BLOB::render_outline |
( |
| ) |
|
Definition at line 524 of file stepblob.cpp.
526 Pix* pix = pixCreate(box.
width(), box.
height(), 1);
527 render_outline_list_outline(&outlines, box.
left(), box.
top(), pix);
TBOX bounding_box() const
◆ rotate()
void C_BLOB::rotate |
( |
const FCOORD & |
rotation | ) |
|
Definition at line 393 of file stepblob.cpp.
394 RotateOutlineList(rotation, &outlines);
◆ SortByXMiddle()
static int C_BLOB::SortByXMiddle |
( |
const void * |
v1, |
|
|
const void * |
v2 |
|
) |
| |
|
inlinestatic |
Definition at line 125 of file stepblob.h.
126 const C_BLOB* blob1 = *
static_cast<const C_BLOB* const*
>(v1);
127 const C_BLOB* blob2 = *
static_cast<const C_BLOB* const*
>(v2);
TBOX bounding_box() const
The documentation for this class was generated from the following files: