GetAverageWordConfidence Method (GdPictureOCR)
In This Topic
Returns the average word confidence of a specified OCR result.
Syntax
'Declaration
Public Function GetAverageWordConfidence( _
ByVal As String _
) As Integer
public int GetAverageWordConfidence(
string
)
public function GetAverageWordConfidence(
: String
): Integer;
public function GetAverageWordConfidence(
: String
) : int;
public: int GetAverageWordConfidence(
string*
)
public:
int GetAverageWordConfidence(
String^
)
Parameters
- OCRResultID
- The unique result identifier of the executed OCR process obtained by the GdPictureOCR.RunOCR method.
Return Value
The value of the average word confidence in the range 0 (worst accuracy) to 100 (best accuracy).
Please always use the GdPictureOCR.GetStat method to determine if this method has been successful.
Example
How to find out the average word confidence of the processed OCR.
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 ...
}
Example
How to find out the average word confidence of the processed OCR.
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 ...
}
See Also