本文整理汇总了C++中Encoder::RecognizedData方法的典型用法代码示例。如果您正苦于以下问题:C++ Encoder::RecognizedData方法的具体用法?C++ Encoder::RecognizedData怎么用?C++ Encoder::RecognizedData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encoder
的用法示例。
在下文中一共展示了Encoder::RecognizedData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Recognize
MessageDataPtr Container::Recognize()
{
Split();
const TrainingWindowPtr training_window = MakeTrainingWindow(training_image_);
const WorkingWindowPtr working_window = MakeWorkingWindow(working_image_);
Encoder encoder;
encoder.Prepare();
unsigned recognize_slide_count = 0;
while (training_window->Next() && working_window->Next())
{
training_window->CalculateProbabilities();
unsigned iterations_count = training_window->PixelIterationsCount();
for (unsigned iterations_counter = 0
; iterations_counter != iterations_count
; ++iterations_counter)
{
for (int i = 0; i != 3; ++i)
{
const int context = training_window->GetContext(iterations_counter, i);
if (!training_window->IsValidContext(context, i))
{
continue;
}
const std::pair<double, double> probabilities =
training_window->GetProbabilitiesByContext(context, i);
const double probability0 = probabilities.first;
const double probability1 = probabilities.second;
encoder.StartModel(probability0, probability1);
const unsigned char encoded_symbol = working_window->Read(iterations_counter, i);
encoder.DecodeNext(encoded_symbol);
}
}
++recognize_slide_count;
}
return encoder.RecognizedData();
}