1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<title>PRC_GetRecognizedEntry*</title> 9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">PRC_GetRecognizedEntry* <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1> 15<H2>Syntax</H2> 16<dl> 17 <dd><PRE><CODE>#include <nitro/prc.h> 18 19fx32 PRC_GetRecognizedEntry( 20 <A href="PRCPrototypeEntry.html">PRCPrototypeEntry</A>** resultEntry, 21 void* buffer, 22 const <A href="PRCInputPattern.html">PRCInputPattern</A>* input, 23 const <A href="PRCPrototypeDB.html">PRCPrototypeDB</A>* protoDB ); 24 25fx32 PRC_GetRecognizedEntryEx( 26 <A href="PRCPrototypeEntry.html">PRCPrototypeEntry</A>** resultEntry, 27 void* buffer, 28 const <A href="PRCInputPattern.html">PRCInputPattern</A>* input, 29 const <A href="PRCPrototypeDB.html">PRCPrototypeDB</A>* protoDB, 30 u32 kindMask, 31 const <A href="PRCRecognizeParam.html">PRCRecognizeParam</A>* param ); 32 33int PRC_GetRecognizedEntries( 34 <A href="PRCPrototypeEntry.html">PRCPrototypeEntry</A>** resultEntries, 35 fx32* resultScores, 36 int numRanking, 37 void* buffer, 38 const <A href="PRCInputPattern.html">PRCInputPattern</A>* input, 39 const <A href="PRCPrototypeDB.html">PRCPrototypeDB</A>* protoDB ); 40 41int PRC_GetRecognizedEntriesEx( 42 <A href="PRCPrototypeEntry.html">PRCPrototypeEntry</A>** resultEntries, 43 fx32* resultScores, 44 int numRanking, 45 void* buffer, 46 const <A href="PRCInputPattern.html">PRCInputPattern</A>* input, 47 const <A href="PRCPrototypeDB.html">PRCPrototypeDB</A>* protoDB, 48 u32 kindMask, 49 const <A href="PRCRecognizeParam.html">PRCRecognizeParam</A>* param ); 50</CODE></PRE></dd> 51</dl> 52 53<h2>Arguments</h2> 54<table border="1" width="100%"> 55 <tbody> 56 <tr> 57 <td width="13%"><em><strong><font face="Courier New">resultEntry</font></strong></em></td> 58 <td width="87%">Pointer for receiving the <code>PRCPrototypeEntry*</code> recognition results.</td> 59 </tr> 60 <TR> 61 <TD width="13%"><EM><STRONG><FONT face="Courier New">buffer</FONT></STRONG></EM></TD> 62 <TD width="87%">Pointer to the memory region used by the recognition algorithm.</TD> 63 </TR> 64 <tr> 65 <td width="13%"><em><strong><font face="Courier New">input</font></strong></em></td> 66 <td width="87%">Input pattern data to be recognized.</td> 67 </tr> 68 <tr> 69 <td width="13%"><em><strong><font face="Courier New">protoDB</font></strong></em></td> 70 <td width="87%">Sample DB.</td> 71 </tr> 72 <tr> 73 <td width="13%"><em><strong><font face="Courier New">kindMask</font></strong></em></td> 74 <td width="87%">Bit field specification of the pattern type that is used to qualify match targets.</td> 75 </tr> 76 <tr> 77 <td width="13%"><em><strong><font face="Courier New">param</font></strong></em></td> 78 <td width="87%">Other parameter values that are dependent on the recognition algorithm (use NULL as the default).</td> 79 </tr> 80 </tbody> 81</table> 82 83<table border="1" width="100%"> 84 <tbody> 85 <tr> 86 <td width="13%"><em><strong><font face="Courier New">resultEntries</font></strong></em></td> 87 <td width="87%">Pointer to the array that receives the <code>PRCPrototypeEntry*</code> recognition results.</td> 88 </tr> 89 <tr> 90 <td width="13%"><em><strong><font face="Courier New">resultScores</font></strong></em></td> 91 <td width="87%">Pointer to the array that receives the recognition result score.</td> 92 </tr> 93 <tr> 94 <td width="13%"><em><strong><font face="Courier New">numRanking</font></strong></em></td> 95 <td width="87%">Specifies up to what rank of the recognition results will be accepted.</td> 96 </tr> 97 </tbody> 98</table> 99 100<h2>Return Values</h2> 101<p><code>PRC_GetRecognizedEntry</code> and <code>PRC_GetRecognizedEntryEx</code> return the recognition result score as a <code><A href="../../fx/fx32.html">fx32</A></code> type.</p> 102<P><code>PRC_GetRecognizedEntries</code> and <code>PRC_GetRecognizedEntriesEx</code> return how many of the sample DB patterns are matching targets.</P> 103<H2>Description</H2> 104<P>Performs pattern recognition. This function matches the <code><A href="PRCInputPattern.html">PRCInputPattern</A></code> type input pattern and each entry in the <code><A href="PRCPrototypeDB.html">PRCPrototypeDB</A></code> type sample DB, and returns those that have high scores.</P> 105<P>When matching, the logical AND is taken of <code><em><strong>kind</strong></em></code> for each sample DB entry in <code><em><strong>protoDB</strong></em></code> and the value of <code><em><strong>kindMask</strong></em></code>. If the result is non-0, the entry will be targeted for matching. Specifying <code>PRC_KIND_ALL</code> in <em><strong><code>kindMask</code></strong></em> will select all <em><strong><code>kinds</code></strong></em>. If the <code><em><strong>enabled</strong></em></code> flag is FALSE, the DB entry will not be targeted for matching, even if the <code><em><strong>kind</strong></em></code> values match.</P> 106<P><code>PRC_GetRecognizedEntry</code> and <code>PRC_GetRecognizedEntryEx</code> return a pointer to the sample DB entry that has the highest score in <code>*resultEntry</code>. If no recognition was achieved, <code>NULL</code> will be returned to <code>*resultEntry</code>.</P> 107<P><code>PRC_GetRecognizedEntries</code> and <code>PRC_GetRecognizedEntriesEx</code> return pointers to high scoring sample DB entries scores above <code><strong><em>numRanking</em></strong></code>, in descending order according to score in <code>resultEntries[]</code>. It returns the numerical value of each score in <code>resultScores[]</code>. If the number of matching target sample DB entries does not reach <code><em><strong>numRanking</strong></em></code>, <code>NULL</code> will be assigned to the unfilled regions of <code>resultEntries[]</code>.</P> 108<P>Note that depending on the selected recognition algorithm and complexity of the input pattern, the number and complexity of the sample DB entries, and on other conditions, the cost of this process can become extremely high. Based on the fact that multiple frames will be involved in recognition, we recommend that this function run on a thread other than the main process. For a sample implementation, see <a href="../../demos/prc/prcdemos.html">prc/characterRecognition-1</a> in the demos.</P> 109<P>Use <code><em><strong>buffer</strong></em></code> to specify the memory region that the recognition algorithm will use. First obtain the amount of memory required using <code><A href="PRC_GetRecognitionBufferSize.html">PRC_GetRecognitionBufferSize*</A></code> and allocate at least that amount.</P> 110<P>Scores are returned as an <code>fx32</code>. The range will be <code>0 <= range <= FX32_ONE</code>.</P> 111<P>Higher scores indicate a recognition result that has a closer resemblance to the pattern. Calling <code>PRC_GetRecognizedEntry, PRC_GetRecognizedEntries</code> is the same as calling <code>PRC_GetRecognizedEntryEx, PRC_GetRecognizedEntriesEx</code> with <code><em><strong>kindMask</strong></em></code> set to <code>PRC_KIND_ALL</code>, and <code><em><strong>param</strong></em></code> set to <code>NULL</code>.</P> 112<P>For details on recognition algorithms, see <code>docs/TechnicalNotes/AboutPatternRecognition.pdf</code>.</P> 113<h2>See Also</h2> 114<p><code><A href="PRC_GetRecognitionBufferSize.html">PRC_GetRecognitionBufferSize*</a></code>, <code><a href="PRCRecognizeParam.html">PRCRecognizeParam</a></code>, <code><a href="PRC_Init.html">PRC_Init</a></code>, <code><a href="PRC_InitPrototypeDB.html">PRC_InitPrototypeDB*</a></code>, <code><a href="PRC_InitInputPattern.html">PRC_InitInputPattern*</a></code>, <code><a href="PRC_GetEntryCode.html">PRC_GetEntryCode</a></code>, <code><a href="PRC_GetEntryData.html">PRC_GetEntryData</A></code></p> 115 116<H2>Revision History</H2> 117<P>2005/02/18 Revised file name of reference document.<br /> 2004/06/23 Initial version.</P> 118<hr><p>CONFIDENTIAL</p></body> 119</html> 120