Load a saved classifier from a file. More...
Inherits object.
Public Member Functions | |
bool | is_minos_16bit_classifier (self) |
Returns True if the classifier was generated by Minos16Bit, False otherwise. More... | |
Union[Tuple[str, cvb.minos.SearchResult], List[cvb.minos.SearchResult]] | read (self, cvb.ImagePlane plane, cvb.Area2D start_aoi, cvb.Area2D ocr_aoi, Optional[float] density, int mode) |
Reads a string of characters with given mode or a list of characters with missing mode information. More... | |
None | save (self, str file_name) |
Write the classifier to a file. More... | |
cvb.minos.SearchResult | search (self, cvb.ImagePlane plane, int mode, Optional[cvb.Area2D] aoi, Optional[float] density) |
Search one object using this Minos classifier. More... | |
List[cvb.minos.SearchResult] | search_all (self, cvb.ImagePlane plane, int locality, Optional[cvb.Area2D] aoi, Optional[float] density=1.0) |
Search all objects using this Minos classifier. More... | |
cvb.minos.Classifier | set_global_advance_vector (self, cvb.Point2D advance) |
Create a new classifier, that is a copy of this classifier, but with a global advance vector applied to all classes in the classifier. More... | |
cvb.minos.Classifier | transform (self, cvb.Matrix2D transformation) |
Generate a new classifier by transforming this classifier with a 2 x 2 transformation matrix. More... | |
Properties | |
comment = property | |
str: Comment assigned to the classifier at generation time. | |
contrast_trigger = property | |
int: Trigger value for the contrast of features to be taken into account. | |
extent = property | |
cvb.Rect: Extent of the classes in the classifier relative to the anchor point. | |
file_name = property | |
str: Name of the file from which this classifier was loaded (empty string, if this image list was neither loaded nor saved since its construction). | |
learn_parameters = property | |
cvb.minos.LearnParameters: Name of the training set from which this classifier was generated. | |
quality_measure = property | |
int: Type of quality feedback from the classifier. | |
threshold = property | |
float: Threshold for search operations with normalized quality feedback. | |
training_set_name = property | |
str: Name of the training set from which this classifier was generated. | |
Load a saved classifier from a file.
Instantiates a Classifier object.
file_name : str Name of the file to be loaded.
Example from QmlMinos tutorial (OCR reading):
bool is_minos_16bit_classifier | ( | self | ) |
Returns True if the classifier was generated by Minos16Bit, False otherwise.
bool True if generated by Minos16Bit, False otherwise.
Union[Tuple[str, cvb.minos.SearchResult], List[cvb.minos.SearchResult]] read | ( | self, | |
cvb.ImagePlane | plane, | ||
cvb.Area2D | start_aoi, | ||
cvb.Area2D | ocr_aoi, | ||
Optional[float] | density, | ||
int | mode | ||
) |
Reads a string of characters with given mode or a list of characters with missing mode information.
plane : cvb.ImagePlane Image plane to read on (1, 2).
start_aoi : cvb.Area2D Area in which to start the read operation (1, 2).
ocr_aoi : cvb.Area2D Area to be used for the intermediate read steps; this area will be applied relative to the expected position of the next character and is typically only a few pixels wide and high (1, 2).
density : Optional[float] Density at which to search ([0...1]) (1, 2).
mode : int Read mode (see cvb.minos.ReadMode). (2)
Union[Tuple[str, cvb.minos.SearchResult], List[cvb.minos.SearchResult]] The string that has been read by this function and the first or last character that has been read (depending on the value of the mode parameter), or the list of characters that has been read by this function.
Example from QmlMinos tutorial (OCR reading):
None save | ( | self, | |
str | file_name | ||
) |
Write the classifier to a file.
file_name : str Path to save to.
cvb.minos.SearchResult search | ( | self, | |
cvb.ImagePlane | plane, | ||
int | mode, | ||
Optional[cvb.Area2D] | aoi, | ||
Optional[float] | density | ||
) |
Search one object using this Minos classifier.
plane : cvb.ImagePlane Image plane to search on.
mode : int Search mode to be used (see cvb.minos.SearchMode).
aoi : Optional[cvb.Area2D] Area to search in.
density : Optional[float] Density at which to search ([0...1]).
cvb.minos.SearchResult The found result (empty SearchResult if none was found).
List[cvb.minos.SearchResult] search_all | ( | self, | |
cvb.ImagePlane | plane, | ||
int | locality, | ||
Optional[cvb.Area2D] | aoi, | ||
Optional[float] | density = 1.0 |
||
) |
Search all objects using this Minos classifier.
plane : cvb.ImagePlane Image plane to search on.
locality : int Radius within which no better solution may exist.
aoi : Optional[cvb.Area2D] Area to search in.
density : Optional[float] Density at which to search ([0...1]).
List[cvb.minos.SearchResult] List of found results.
cvb.minos.Classifier set_global_advance_vector | ( | self, | |
cvb.Point2D | advance | ||
) |
Create a new classifier, that is a copy of this classifier, but with a global advance vector applied to all classes in the classifier.
advance : cvb.Point2D Advance vector to apply globally.
cvb.minos.Classifier The new classifier.
cvb.minos.Classifier transform | ( | self, | |
cvb.Matrix2D | transformation | ||
) |
Generate a new classifier by transforming this classifier with a 2 x 2 transformation matrix.
transformation : cvb.Matrix2D Matrix with which to transform the geometry of this classifier.
cvb.minos.Classifier The transformed classifier.