Dim caption As String = "Example: GetAverageWordConfidence"
Using gdpictureOCR As GdPictureOCR = New GdPictureOCR()
'Set up your prefered parameters for OCR.
'Set up the image you want to process. This step is mandatory.
'Run the OCR process.
Dim resID As String = gdpictureOCR.RunOCR()
If gdpictureOCR.GetStat() = GdPictureStatus.OK Then
Dim wordConf As Integer = gdpictureOCR.GetAverageWordConfidence(resID)
If gdpictureOCR.GetStat() = GdPictureStatus.OK Then
MessageBox.Show("The average word confidence of this OCR result is: " + wordConf, caption)
Else
MessageBox.Show("The GetAverageWordConfidence() method has failed with the status: " + gdpictureOCR.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The OCR process has failed with the status: " + gdpictureOCR.GetStat().ToString(), caption)
End If
'Continue ...
End Using
string caption = "Example: GetAverageWordConfidence";
using (GdPictureOCR gdpictureOCR = new GdPictureOCR())
{
//Set up your prefered parameters for OCR.
//Set up the image you want to process. This step is mandatory.
//Run the OCR process.
string resID = gdpictureOCR.RunOCR();
if (gdpictureOCR.GetStat() == GdPictureStatus.OK)
{
int wordConf = gdpictureOCR.GetAverageWordConfidence(resID);
if (gdpictureOCR.GetStat() == GdPictureStatus.OK)
MessageBox.Show("The average word confidence of this OCR result is: " + wordConf, caption);
else
MessageBox.Show("The GetAverageWordConfidence() method has failed with the status: " + gdpictureOCR.GetStat().ToString(), caption);
}
else
{
MessageBox.Show("The OCR process has failed with the status: " + gdpictureOCR.GetStat().ToString(), caption);
}
//Continue ...
}