~sahana-agasti-ocr/+junk/working_source

« back to all changes in this revision

Viewing changes to Projects/common/Header_files/edgloop.h

  • Committer: Thilanka
  • Date: 2010-07-14 07:34:15 UTC
  • Revision ID: thilanka@thilanka-laptop-20100714073415-1etpm1i0xtbrldus
This commit contains all the working source for sahana OCR till midterm evaluation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**********************************************************************
 
2
 * File:        edgloop.h  (Formerly edgeloop.h)
 
3
 * Description: Functions to clean up an outline before approximation.
 
4
 * Author:                                      Ray Smith
 
5
 * Created:                                     Tue Mar 26 16:56:25 GMT 1991
 
6
 *
 
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.
 
17
 *
 
18
 **********************************************************************/
 
19
 
 
20
#ifndef           EDGLOOP_H
 
21
#define           EDGLOOP_H
 
22
 
 
23
#include          "scrollview.h"
 
24
#include          "varable.h"
 
25
#include          "img.h"
 
26
#include          "pdblock.h"
 
27
#include          "coutln.h"
 
28
#include          "crakedge.h"
 
29
 
 
30
#define BUCKETSIZE      16
 
31
 
 
32
 
 
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
 
49
#endif
 
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
 
55
                        );
 
56
void complete_edge(                  //clean and approximate
 
57
                   CRACKEDGE *start  //start of loop
 
58
                  );
 
59
ScrollView::Color check_path_legal(                  //certify outline
 
60
                        CRACKEDGE *start  //start of loop
 
61
                       );
 
62
inT16 loop_bounding_box(                    //get bounding box
 
63
                        CRACKEDGE *&start,  //edge loop
 
64
                        ICOORD &botleft,    //bounding box
 
65
                        ICOORD &topright);
 
66
#endif