Tesseract 3.01
|
00001 00002 // File: linefind.h 00003 // Description: Class to find vertical lines in an image and create 00004 // a corresponding list of empty blobs. 00005 // Author: Ray Smith 00006 // Created: Thu Mar 20 09:49:01 PDT 2008 00007 // 00008 // (C) Copyright 2008, Google Inc. 00009 // Licensed under the Apache License, Version 2.0 (the "License"); 00010 // you may not use this file except in compliance with the License. 00011 // You may obtain a copy of the License at 00012 // http://www.apache.org/licenses/LICENSE-2.0 00013 // Unless required by applicable law or agreed to in writing, software 00014 // distributed under the License is distributed on an "AS IS" BASIS, 00015 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00016 // See the License for the specific language governing permissions and 00017 // limitations under the License. 00018 // 00020 00021 #ifndef TESSERACT_TEXTORD_LINEFIND_H__ 00022 #define TESSERACT_TEXTORD_LINEFIND_H__ 00023 00024 struct Pix; 00025 struct Boxa; 00026 class C_BLOB_LIST; 00027 class BLOBNBOX_LIST; 00028 class ICOORD; 00029 00030 namespace tesseract { 00031 00032 class TabVector_LIST; 00033 00038 class LineFinder { 00039 public: 00052 static void FindVerticalLines(int resolution, Pix* pix, 00053 int* vertical_x, int* vertical_y, 00054 TabVector_LIST* vectors); 00055 00065 static void FindHorizontalLines(int resolution, Pix* pix, 00066 TabVector_LIST* vectors); 00067 00077 static void ConvertBoxaToBlobs(int image_width, int image_height, 00078 Boxa** boxes, C_BLOB_LIST* blobs); 00079 00080 private: 00090 static void FindLineVectors(const ICOORD& bleft, const ICOORD& tright, 00091 BLOBNBOX_LIST* line_bblobs, 00092 int* vertical_x, int* vertical_y, 00093 TabVector_LIST* vectors); 00094 00102 static Boxa* GetVLineBoxes(int resolution, Pix* src_pix, Pix** line_pix); 00103 00117 static Boxa* GetHLineBoxes(int resolution, Pix* src_pix, Pix** line_pix); 00118 }; 00119 00120 } // namespace tesseract. 00121 00122 #endif // TESSERACT_TEXTORD_LINEFIND_H__ 00123