Tesseract  3.02
tesseract-ocr/wordrec/plotseg.h File Reference
#include "states.h"
#include "render.h"

Go to the source code of this file.

Functions

void display_segmentation (TBLOB *chunks, SEARCH_STATE segmentation)
void render_segmentation (ScrollView *window, TBLOB *chunks, SEARCH_STATE segmentation)

Variables

ScrollViewsegm_window
int wordrec_display_segmentations = 0

Function Documentation

void display_segmentation ( TBLOB chunks,
SEARCH_STATE  segmentation 
)

Definition at line 57 of file plotseg.cpp.

                                                                    {
  /* If no window create it */
  if (segm_window == NULL) {
    segm_window = c_create_window ("Segmentation", 5, 10,
      500, 256, -1000.0, 1000.0, 0.0, 256.0);
  }
  else {
    c_clear_window(segm_window);
  }

  render_segmentation(segm_window, chunks, segmentation);
  /* Put data in the window */
  c_make_current(segm_window);
}
void render_segmentation ( ScrollView window,
TBLOB chunks,
SEARCH_STATE  segmentation 
)

Definition at line 78 of file plotseg.cpp.

                                                    {
  TBLOB *blob;
  C_COL color = Black;
  int char_num = -1;
  int chunks_left = 0;

  TBOX bbox;
  if (chunks) bbox = chunks->bounding_box();

  for (blob = chunks; blob != NULL; blob = blob->next) {
    bbox += blob->bounding_box();
    if (chunks_left-- == 0) {
      color = color_list[++char_num % NUM_COLORS];

      if (char_num < segmentation[0])
        chunks_left = segmentation[char_num + 1];
      else
        chunks_left = MAX_INT32;
    }
    render_outline(window, blob->outlines, color);
  }
  window->ZoomToRectangle(bbox.left(), bbox.top(),
                          bbox.right(), bbox.bottom());
}

Variable Documentation

Definition at line 45 of file plotseg.cpp.

"Display Segmentations"

Definition at line 47 of file plotseg.cpp.