ccmain/paircmp.h File Reference

#include "ocrblock.h"
#include "varable.h"
#include "notdll.h"

Go to the source code of this file.

Functions


Function Documentation

float compare_bln_blobs ( PBLOB blob1,
DENORM denorm1,
PBLOB blob2,
DENORM denorm2 
)

Compare 2 baseline normalised blobs and return the rating.

Definition at line 79 of file paircmp.cpp.

References compare_tess_blobs(), free_blob(), make_tess_blob(), make_tess_row(), and TRUE.

Referenced by compare_blobs(), and CHAR_SAMPLE::match_sample().

00083                                          {
00084   TBLOB *tblob1;                 //tessblobs
00085   TBLOB *tblob2;
00086   TEXTROW tessrow1, tessrow2;    //tess rows
00087   float rating;                  //match result
00088 
00089   tblob1 = make_tess_blob (blob1, TRUE);
00090   make_tess_row(denorm1, &tessrow1); 
00091   tblob2 = make_tess_blob (blob2, TRUE);
00092   make_tess_row(denorm2, &tessrow2); 
00093   rating = compare_tess_blobs (tblob1, &tessrow1, tblob2, &tessrow2);
00094   free_blob(tblob1); 
00095   free_blob(tblob2); 
00096 
00097   return rating;
00098 }

BOOL8 compare_blob_pairs ( BLOCK ,
ROW row,
WERD ,
PBLOB blob 
)

A blob processor to compare pairs of selected blobs.

Definition at line 30 of file paircmp.cpp.

References compare_blobs(), NULL, tprintf(), and TRUE.

00035                           {
00036   static ROW *prev_row = NULL;   //other in pair
00037   static PBLOB *prev_blob = NULL;
00038   float rating;                  //from matcher
00039 
00040   if (prev_row == NULL || prev_blob == NULL) {
00041     prev_row = row;
00042     prev_blob = blob;
00043   }
00044   else {
00045     rating = compare_blobs (prev_blob, prev_row, blob, row);
00046     tprintf ("Rating=%g\n", rating);
00047     prev_row = NULL;
00048     prev_blob = NULL;
00049   }
00050   return TRUE;
00051 }

float compare_blobs ( PBLOB blob1,
ROW row1,
PBLOB blob2,
ROW row2 
)

Compare 2 blobs and return the rating.

Definition at line 57 of file paircmp.cpp.

00061                                {
00062   PBLOB *bn_blob1;               //baseline norm
00063   PBLOB *bn_blob2;
00064   DENORM denorm1, denorm2;
00065   float rating;                  //match result
00066 
00067   bn_blob1 = blob1->baseline_normalise (row1, &denorm1);
00068   bn_blob2 = blob2->baseline_normalise (row2, &denorm2);
00069   rating = compare_bln_blobs (bn_blob1, &denorm1, bn_blob2, &denorm2);
00070   delete bn_blob1;
00071   delete bn_blob2;
00072   return rating;
00073 }


Generated on Wed Feb 28 19:49:15 2007 for Tesseract by  doxygen 1.5.1