1
/**********************************************************************
2
* File: edgloop.h (Formerly edgeloop.h)
3
* Description: Functions to clean up an outline before approximation.
5
* Created: Tue Mar 26 16:56:25 GMT 1991
7
* (C) Copyright 1991, Hewlett-Packard Ltd.
8
** Licensed under the Apache License, Version 2.0 (the "License");
9
** you may not use this file except in compliance with the License.
10
** You may obtain a copy of the License at
11
** http://www.apache.org/licenses/LICENSE-2.0
12
** Unless required by applicable law or agreed to in writing, software
13
** distributed under the License is distributed on an "AS IS" BASIS,
14
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
** See the License for the specific language governing permissions and
16
** limitations under the License.
18
**********************************************************************/
23
#include "scrollview.h"
33
extern double_VAR_H (edges_threshold_greyfraction, 0.07,
34
"Min edge diff for grad vector");
35
extern BOOL_VAR_H (edges_show_paths, FALSE, "Draw raw outlines");
36
extern BOOL_VAR_H (edges_show_needles, FALSE, "Draw edge needles");
37
extern INT_VAR_H (edges_children_per_grandchild, 10,
38
"Importance ratio for chucking outlines");
39
extern INT_VAR_H (edges_children_count_limit, 45,
40
"Max holes allowed in blob");
41
extern INT_VAR_H (edges_maxedgelength, 16000, "Max steps in any outline");
42
extern double_VAR_H (edges_childarea, 0.5,
43
"Max area fraction of child outline");
44
extern double_VAR_H (edges_boxarea, 0.8,
45
"Min area fraction of grandchild for box");
46
DLLSYM void get_outlines( //edge detect
47
#ifndef GRAPHICS_DISABLED
48
ScrollView* window, //window for output
50
IMAGE *image, //image to scan
51
IMAGE *t_image, //thresholded image
52
ICOORD page_tr, //corner of page
53
PDBLK *block, //block to scan
54
C_OUTLINE_IT *out_it //output iterator
56
void complete_edge( //clean and approximate
57
CRACKEDGE *start //start of loop
59
ScrollView::Color check_path_legal( //certify outline
60
CRACKEDGE *start //start of loop
62
inT16 loop_bounding_box( //get bounding box
63
CRACKEDGE *&start, //edge loop
64
ICOORD &botleft, //bounding box