#include "states.h"
#include "render.h"
Go to the source code of this file.
void display_segmentation | ( | TBLOB * | chunks, | |
SEARCH_STATE | segmentation | |||
) |
Display all the words on the page into a window.
Definition at line 49 of file plotseg.cpp.
References c_clear_window(), c_create_window(), c_make_current(), NULL, render_segmentation(), and segm_window.
Referenced by classify_piece(), evaluate_state(), and save_best_state().
00049 { 00050 void *window; 00051 00052 /* Destroy old data */ 00053 /* If no window create it */ 00054 if (segm_window == NULL) { 00055 segm_window = c_create_window ("Segmentation", 5, 10, 00056 500, 128, -1000.0, 1000.0, 0.0, 256.0); 00057 } 00058 else { 00059 c_clear_window(segm_window); 00060 } 00061 00062 window = segm_window; 00063 00064 render_segmentation(window, chunks, segmentation); 00065 /* Put data in the window */ 00066 c_make_current(window); 00067 }
void init_plotseg | ( | ) |
Intialize the plotseg control variables.
Definition at line 74 of file plotseg.cpp.
Referenced by init_ms_debug().
void render_segmentation | ( | void * | window, | |
TBLOB * | chunks, | |||
SEARCH_STATE | segmentation | |||
) |
Create a list of line segments that represent the list of chunks using the correct segmentation that was supplied as input.
Definition at line 84 of file plotseg.cpp.
References Black, blobs_origin(), color_list, iterate_blobs, MAXINT, NUM_COLORS, blobstruct::outlines, and render_outline().
Referenced by display_segmentation().
00086 { 00087 TPOINT origin; 00088 TBLOB *blob; 00089 C_COL color = Black; 00090 int char_num = -1; 00091 int chunks_left = 0; 00092 00093 blobs_origin(chunks, &origin); 00094 00095 iterate_blobs(blob, chunks) { 00096 00097 if (chunks_left-- == 0) { 00098 color = color_list[++char_num % NUM_COLORS]; 00099 00100 if (char_num < segmentation[0]) 00101 chunks_left = segmentation[char_num + 1]; 00102 else 00103 chunks_left = MAXINT; 00104 } 00105 render_outline (window, blob->outlines, origin, color); 00106 } 00107 }
Display Segmentations
Referenced by classify_piece(), evaluate_state(), and pop_queue().
void* segm_window |
* (c) Copyright 1987, Hewlett-Packard Company. ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** http://www.apache.org/licenses/LICENSE-2.0 ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License.
Definition at line 34 of file plotseg.cpp.
Referenced by classify_piece(), display_segmentation(), evaluate_state(), and save_best_state().