tesseract 3.04.01

classify/mfx.h File Reference

#include "mfdefs.h"
#include "params.h"

Go to the source code of this file.

Functions

MICROFEATURES BlobMicroFeatures (TBLOB *Blob, const DENORM &cn_denorm)

Variables

double classify_min_slope = 0.414213562
double classify_max_slope = 2.414213562

Function Documentation

MICROFEATURES BlobMicroFeatures ( TBLOB Blob,
const DENORM cn_denorm 
)

This routine extracts micro-features from the specified blob and returns a list of the micro-features. All micro-features are normalized according to the specified line statistics.

Parameters:
Blobblob to extract micro-features from
cn_denormcontrol parameter to feature extractor
Returns:
List of micro-features extracted from the blob.
Note:
Exceptions: none
History: 7/21/89, DSJ, Created.

Definition at line 72 of file mfx.cpp.

                                                                      {
  MICROFEATURES MicroFeatures = NIL_LIST;
  LIST Outlines;
  LIST RemainingOutlines;
  MFOUTLINE Outline;

  if (Blob != NULL) {
    Outlines = ConvertBlob(Blob);

    RemainingOutlines = Outlines;
    iterate(RemainingOutlines) {
      Outline = (MFOUTLINE) first_node (RemainingOutlines);
      CharNormalizeOutline(Outline, cn_denorm);
    }

    RemainingOutlines = Outlines;
    iterate(RemainingOutlines) {
      Outline = (MFOUTLINE) first_node(RemainingOutlines);
      FindDirectionChanges(Outline, classify_min_slope, classify_max_slope);
      MarkDirectionChanges(Outline);
      MicroFeatures = ConvertToMicroFeatures(Outline, MicroFeatures);
    }
    FreeOutlines(Outlines);
  }
  return MicroFeatures;
}                                /* BlobMicroFeatures */

Variable Documentation

double classify_max_slope = 2.414213562

"Slope above which lines are called vertical"

Definition at line 39 of file mfx.cpp.

double classify_min_slope = 0.414213562

"Slope below which lines are called horizontal"

Definition at line 37 of file mfx.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines