#include "speckle.h"
#include "debug.h"
#include "blobs.h"
Go to the source code of this file.
Adds a null choice to Choices with a rating equal to the worst rating in Choices, plus a pad.
Choices | Choices to add a speckle choice to |
Definition at line 80 of file speckle.cpp.
References append_choice(), best_certainty, best_probability, last(), NIL, SmallSpeckleCertainty, and SmallSpecklePenalty.
Referenced by AdaptiveClassifier().
00080 { 00081 LIST WorstChoice; 00082 00083 /* if there are no other choices, use the small speckle penalty plus 00084 the large speckle penalty */ 00085 if (Choices == NIL) 00086 return (append_choice (NIL, "", SmallSpecklePenalty + LargeSpecklePenalty, 00087 SmallSpeckleCertainty, -1)); 00088 00089 /* if there are other choices, add a null choice that is slightly worse 00090 than the worst choice so far */ 00091 WorstChoice = last (Choices); 00092 return (append_choice (Choices, "", 00093 best_probability (WorstChoice) + LargeSpecklePenalty, 00094 best_certainty (WorstChoice), -1)); 00095 00096 } /* AddLargeSpeckleTo */
void InitSpeckleVars | ( | ) |
Install the control variables needed for the speckle filters.
none |
Definition at line 108 of file speckle.cpp.
References cprintf().
Referenced by init_dj_debug().
00108 { 00109 MakeMaxLargeSpeckleSize(); 00110 MakeSmallSpecklePenalty(); 00111 MakeLargeSpecklePenalty(); 00112 MakeSmallSpeckleCertainty(); 00113 #ifdef TEXT_VERBOSE 00114 // gets a 'k', see ccmain/tesseractmain.dox 00115 cprintf("k"); 00116 #endif 00117 } /* InitSpeckleVars */
Decides if both the width of height of Blob are less than the MaxLargeSpeckleSize.
Blob | Blob to test against speckle criteria | |
Row | Text row that blob is in |
Definition at line 132 of file speckle.cpp.
References blob_bounding_box(), FALSE, RowHeight, TRUE, TPOINT::x, and TPOINT::y.
Referenced by AdaptiveClassifier().
00132 { 00133 FLOAT32 SpeckleSize; 00134 TPOINT TopLeft; 00135 TPOINT BottomRight; 00136 00137 SpeckleSize = RowHeight (Row) * MaxLargeSpeckleSize; 00138 blob_bounding_box(Blob, &TopLeft, &BottomRight); 00139 00140 if (TopLeft.y - BottomRight.y < SpeckleSize && 00141 BottomRight.x - TopLeft.x < SpeckleSize) 00142 return (TRUE); 00143 else 00144 return (FALSE); 00145 } /* LargeSpeckle */