#include "blobbox.h"
#include "allheaders.h"
#include "blobs.h"
#include "helpers.h"
#include "normalis.h"
Go to the source code of this file.
|
void | find_cblob_limits (C_BLOB *blob, float leftx, float rightx, FCOORD rotation, float &ymin, float &ymax) |
|
void | find_cblob_vlimits (C_BLOB *blob, float leftx, float rightx, float &ymin, float &ymax) |
|
void | find_cblob_hlimits (C_BLOB *blob, float bottomy, float topy, float &xmin, float &xmax) |
|
C_BLOB * | crotate_cblob (C_BLOB *blob, FCOORD rotation) |
|
TBOX | box_next (BLOBNBOX_IT *it) |
|
TBOX | box_next_pre_chopped (BLOBNBOX_IT *it) |
|
void | vertical_cblob_projection (C_BLOB *blob, STATS *stats) |
|
void | vertical_coutline_projection (C_OUTLINE *outline, STATS *stats) |
|
void | plot_blob_list (ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour) |
|
◆ EXTERN
◆ PROJECTION_MARGIN
#define PROJECTION_MARGIN 10 |
◆ box_next()
TBOX box_next |
( |
BLOBNBOX_IT * |
it | ) |
|
Definition at line 631 of file blobbox.cpp.
642 if (blob->
cblob() == NULL)
const TBOX & bounding_box() const
bool joined_to_prev() const
◆ box_next_pre_chopped()
TBOX box_next_pre_chopped |
( |
BLOBNBOX_IT * |
it | ) |
|
Definition at line 660 of file blobbox.cpp.
const TBOX & bounding_box() const
bool joined_to_prev() const
◆ crotate_cblob()
Definition at line 606 of file blobbox.cpp.
610 C_OUTLINE_LIST out_list;
612 C_OUTLINE_IT in_it = blob->
out_list ();
614 C_OUTLINE_IT out_it = &out_list;
616 for (in_it.mark_cycle_pt (); !in_it.cycled_list (); in_it.forward ()) {
617 out_it.add_after_then_move (
new C_OUTLINE (in_it.data (), rotation));
619 return new C_BLOB (&out_list);
C_OUTLINE_LIST * out_list()
◆ find_cblob_hlimits()
void find_cblob_hlimits |
( |
C_BLOB * |
blob, |
|
|
float |
bottomy, |
|
|
float |
topy, |
|
|
float & |
xmin, |
|
|
float & |
xmax |
|
) |
| |
Definition at line 571 of file blobbox.cpp.
582 C_OUTLINE_IT out_it = blob->
out_list ();
586 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
587 outline = out_it.data ();
589 for (stepindex = 0; stepindex < outline->
pathlength (); stepindex++) {
591 if (pos.
y () >= bottomy && pos.
y () <= topy) {
594 vec = outline->
step (stepindex);
void UpdateRange(const T1 &x, T2 *lower_bound, T2 *upper_bound)
ICOORD step(int index) const
C_OUTLINE_LIST * out_list()
inT16 x() const
access function
const ICOORD & start_pos() const
inT16 y() const
access_function
◆ find_cblob_limits()
void find_cblob_limits |
( |
C_BLOB * |
blob, |
|
|
float |
leftx, |
|
|
float |
rightx, |
|
|
FCOORD |
rotation, |
|
|
float & |
ymin, |
|
|
float & |
ymax |
|
) |
| |
Definition at line 494 of file blobbox.cpp.
506 C_OUTLINE_IT out_it = blob->
out_list ();
510 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
511 outline = out_it.data ();
514 for (stepindex = 0; stepindex < outline->
pathlength (); stepindex++) {
516 if (pos.
x () >= leftx && pos.
x () <= rightx) {
519 vec = outline->
step (stepindex);
void UpdateRange(const T1 &x, T2 *lower_bound, T2 *upper_bound)
ICOORD step(int index) const
C_OUTLINE_LIST * out_list()
inT16 x() const
access function
void rotate(const FCOORD &vec)
const ICOORD & start_pos() const
inT16 y() const
access_function
◆ find_cblob_vlimits()
void find_cblob_vlimits |
( |
C_BLOB * |
blob, |
|
|
float |
leftx, |
|
|
float |
rightx, |
|
|
float & |
ymin, |
|
|
float & |
ymax |
|
) |
| |
Definition at line 534 of file blobbox.cpp.
545 C_OUTLINE_IT out_it = blob->
out_list ();
549 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
550 outline = out_it.data ();
552 for (stepindex = 0; stepindex < outline->
pathlength (); stepindex++) {
554 if (pos.
x () >= leftx && pos.
x () <= rightx) {
557 vec = outline->
step (stepindex);
void UpdateRange(const T1 &x, T2 *lower_bound, T2 *upper_bound)
ICOORD step(int index) const
C_OUTLINE_LIST * out_list()
inT16 x() const
access function
const ICOORD & start_pos() const
inT16 y() const
access_function
◆ plot_blob_list()
Definition at line 1082 of file blobbox.cpp.
1086 BLOBNBOX_IT it = list;
1087 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
1088 it.data()->plot(win, body_colour, child_colour);
◆ vertical_cblob_projection()
void vertical_cblob_projection |
( |
C_BLOB * |
blob, |
|
|
STATS * |
stats |
|
) |
| |
Definition at line 863 of file blobbox.cpp.
868 C_OUTLINE_IT out_it = blob->
out_list ();
870 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
C_OUTLINE_LIST * out_list()
void vertical_coutline_projection(C_OUTLINE *outline, STATS *stats)
◆ vertical_coutline_projection()
void vertical_coutline_projection |
( |
C_OUTLINE * |
outline, |
|
|
STATS * |
stats |
|
) |
| |
Definition at line 883 of file blobbox.cpp.
891 C_OUTLINE_IT out_it = outline->
child ();
895 for (stepindex = 0; stepindex < length; stepindex++) {
896 step = outline->
step (stepindex);
898 stats->
add (pos.
x (), -pos.
y ());
899 }
else if (step.
x () < 0) {
900 stats->
add (pos.
x () - 1, pos.
y ());
905 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
void add(inT32 value, inT32 count)
ICOORD step(int index) const
inT16 x() const
access function
const ICOORD & start_pos() const
void vertical_coutline_projection(C_OUTLINE *outline, STATS *stats)
inT16 y() const
access_function
◆ kComplexShapePerimeterRatio
const double kComplexShapePerimeterRatio = 1.5 |
◆ kCosSmallAngle
const double kCosSmallAngle = 0.866 |
◆ kDefiniteAspectRatio
const double kDefiniteAspectRatio = 2.0 |
◆ kMaxMediumSizeRatio
const double kMaxMediumSizeRatio = 4.0 |
◆ kMinMediumSizeRatio
const double kMinMediumSizeRatio = 0.25 |