Fix OCRBeamSearchDecoder bug: a risk of assigning value to NULL.

pull/3790/head
masterAllen 8 months ago
parent 1aab1f3481
commit ed10e2d289
  1. 3
      modules/text/src/ocr_beamsearch_decoder.cpp

@ -338,8 +338,11 @@ public:
double lp = score_segmentation( beam[0].segmentation, out_sequence );
// fill other (dummy) output parameters
if (component_rects != NULL)
component_rects->push_back(Rect(0,0,src.cols,src.rows));
if (component_texts != NULL)
component_texts->push_back(out_sequence);
if (component_confidences != NULL)
component_confidences->push_back((float)exp(lp));
return;

Loading…
Cancel
Save