tesseract v5.3.3.20231005
equationdetectbase.h
Go to the documentation of this file.
1
2// File: equationdetectbase.h
3// Description: The base class equation detection class.
4// Author: Zongyi (Joe) Liu (joeliu@google.com)
5// Created: Fri Aug 31 11:13:01 PST 2011
6//
7// (C) Copyright 2011, Google Inc.
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//
19
20#ifndef TESSERACT_TEXTORD_EQUATIONDETECTBASE_H_
21#define TESSERACT_TEXTORD_EQUATIONDETECTBASE_H_
22
23#include "image.h"
24
25class BLOBNBOX_LIST;
26class TO_BLOCK;
27struct Pix;
28
29namespace tesseract {
30
31class ColPartitionGrid;
32class ColPartitionSet;
33class BLOBNBOX;
34
36public:
37 EquationDetectBase() = default;
39
40 // Iterate over the blobs inside to_block, and set the blobs that we want to
41 // process to BSTT_NONE. (By default, they should be BSTT_SKIP). The function
42 // returns 0 upon success.
43 virtual int LabelSpecialText(TO_BLOCK *to_block) = 0;
44
45 // Interface to find possible equation partition grid from part_grid. This
46 // should be called after IdentifySpecialText function.
47 virtual int FindEquationParts(ColPartitionGrid *part_grid, ColPartitionSet **best_columns) = 0;
48
49 // Debug function: Render a bounding box on pix based on the value of its
50 // special_text_type, specifically:
51 // BSTT_MATH: red box
52 // BSTT_DIGIT: cyan box
53 // BSTT_ITALIC: green box
54 // BSTT_UNCLEAR: blue box
55 // All others: yellow box
56 static void RenderSpecialText(Image pix, BLOBNBOX *blob);
57};
58
59} // namespace tesseract
60
61#endif // TESSERACT_TEXTORD_EQUATIONDETECTBASE_H_
virtual int FindEquationParts(ColPartitionGrid *part_grid, ColPartitionSet **best_columns)=0
virtual int LabelSpecialText(TO_BLOCK *to_block)=0
#define TESS_API
Definition: export.h:32