ACTIVESWLib::ISPCompare Interface Reference
Detailed Description
SignWare Dynamic Development toolkit, ActiveX wrapper for SPCompareInterface ISPCompare.Compare signatures and references or templates or static images using the static and / or dynamic and / or statistic comparison engines.
ISPCompare instances save all properties such as match quality or projection factor within the instance object for later usage in the compare functions.
The application will typically select the engines to use (SetMode), set compare parameters (SetMatchQualityEx) and perform the comparison (CompareReference, CompareTemplate, CompareImage, CompareStaticReference, CompareStaticTemplate, CompareStaticImage).
The final result (GetResult) is composed from the result of all engines, the final result will be false (no match) if any of the selected engines calculated a match rate less than the minimum match quality for the engine.
The application may query the detailed results of all selected engines (GetDetailResult, GetNumResults) and implement another match algorithm based on the detail results.
The ISPCompare class uses several engines to compare signatures, a dynamic, a static and a statistic engine. The match quality of all engines is normalized in the range 0 ... 100, where 0 means very low match quality, and 100 means high probability that signature and reference were entered by the same person.
Do not assume that there is a linear relation of match quality and signature similarity.
Please read section sec_Performance and section sec_StaticPerformance
// Example (C#) public int Compare(SPReference aReference, SPSignature aSignature, int iMode) { SPCompare spCompare = new SPCompare(); int rc = spCompare.Create(); if(rc != (int) SPError.SPX_NOERR) return rc; if((iMode & (int) SPCompareMode.SPX_COMPARE_DYNAMIC) != 0) { int iSampleRateSigno; int iSampleRateRef; int iPressSigno; int iPressRef; int iSignos; aSignature.GetMaxPressure(out iPressSigno); aSignature.GetSampleRate(out iSampleRateSigno); SPSignature aSigno = new SPSignature(); aSigno.CreateFromReference(aReference, 0); aSigno.GetMaxPressure(out iPressRef); aSigno.GetSampleRate(out iSampleRateRef); aRef.GetSignatureCount(out iSignos); if(iSampleRateSigno == 0 || iSampleRateRef == 0 || iPressSigno <= 2 || iPressRef <= 2 || iSignos < 2) { // Signature or reference do not fulfill requirements for dynamic engine, but can use statistic engine iMode &= ~(int) SPCompareMode.SPX_COMPARE_DYNAMIC; iMode |= (int) SPCompareMode.SPX_COMPARE_DSTAT; } } rc = spCompare.setMode(iMode); if(rc != (int) SPError.SPX_NOERR) return rc; rc = spCompare.CompareReference(aReference, aSignature); if(rc != (int) SPError.SPX_NOERR) return rc; // Query the final result from the SPCompare object int iRes; rc = spCompare.GetResult(out iRes); if(rc != (int) SPError.SPX_NOERR) return rc; // dump detailed results GetDetailResult(spCompare, SPCompareEngine.SPX_COMPARE_DYNAMIC_ENGINE, "dynamic"); GetDetailResult(spCompare, SPCompareEngine.SPX_COMPARE_DSTAT_ENGINE, "statistic"); GetDetailResult(spCompare, SPCompareEngine.SPX_COMPARE_STATIC_ENGINE, "static"); return iRes; } private void GetDetailResult(SPCompare spCompare, SPCompareEngine aEngine, String strEngine) { int iNumResults; String strRes(""); spCompare.GetNumResults((int)aEngine, out iNumResults); if(iNumResults > 0) { for (int ik = 0; ik < iNumResults; ik++) { int iOutVal; spCompare.GetDetailResult((int)aEngine, ik, out iOutVal); if (iOutVal < 0) { // Error String errStr; SPSignware spSignware = new SPSignware(); spSignware.GetErrorString(iOutVal, out errStr); strRes += strEngine + "[" + ik + "]: " + iOutVal + ", " + errStr + "\n"; } else { strRes += strEngine + "[" + ik + "]: " + iOutVal + "\n"; } } Console.WriteLine(strRes); } }
Public Member Functions | |
HRESULT | CompareImage ([in] ISPImage *pImage,[in] ISPSignature *pSignature,[out, retval] long *result) |
compare a signature with a static image | |
HRESULT | CompareReference ([in] ISPReference *pReference,[in] ISPSignature *pSignature,[out, retval] long *result) |
compare a signature with a reference | |
HRESULT | CompareStaticImage ([in] ISPImage *pImage,[in] ISPImage *pSignature,[out, retval] long *result) |
compare a static signature with a static reference | |
HRESULT | CompareStaticReference ([in] ISPReference *pReference,[in] ISPImage *pSignature,[out, retval] long *result) |
compare a static signature with a reference | |
HRESULT | CompareStaticTemplate ([in] ISPTemplate *pTemplate,[in] ISPImage *pSignature,[out, retval] long *result) |
compare a static signature with a template | |
HRESULT | CompareTemplate ([in] ISPTemplate *pTemplate,[in] ISPSignature *pSignature,[out, retval] long *result) |
compare a signature with a template | |
HRESULT | Create ([out, retval] long *result) |
Create the comppare instance. | |
HRESULT | GetDetailResult ([in] long lEngine,[in] long iIndex,[out] long *piResult,[out, retval] long *result) |
Get the result for the specified engine. | |
HRESULT | GetDynamicMatchQuality ([out] long *piMinDynamicQuality,[out, retval] long *result) |
Get the min. Match rate for dynamic verfication. | |
HRESULT | GetDynamicResult ([out] long *piResult,[out, retval] long *result) |
Get the result of a dynamic comparison. | |
HRESULT | GetMatchQuality ([out] long *piMinDynamicQuality,[out] long *piMinStaticQuality,[out, retval] long *result) |
Get the min. Match rate for static and dynamic verfication. | |
HRESULT | GetMatchQualityEx ([in] long lEngine,[out] long *piMinQuality,[out, retval] long *result) |
Get the min. Match rate for the specified verfication. | |
HRESULT | GetMode ([out] long *piMode,[out, retval] long *result) |
Get the compare mode. | |
HRESULT | GetNumResults ([in] long lEngine,[out] long *piResult,[out, retval] long *result) |
Query the number of available results for the specified engine. | |
HRESULT | GetResult ([out] long *piResult,[out, retval] long *result) |
Get the final result of a comparison. | |
HRESULT | GetStaticMatchQuality ([out] long *piMinStaticQuality,[out, retval] long *result) |
Get the min. Match rate for static verfication. | |
HRESULT | GetStaticResult ([in] long iIndex,[out] long *piResult,[out, retval] long *result) |
Get the result of a static comparison. | |
HRESULT | SetDynamicMatchQuality ([in] long iMinDynamicQuality,[out, retval] long *result) |
Set the min. Match rate for sdynamic verfication. | |
HRESULT | SetMatchQuality ([in] long iMinDynamicQuality,[in] long iMinStaticQuality,[out, retval] long *result) |
Set the min. Match rate for static and dynamic verfication. | |
HRESULT | SetMatchQualityEx ([in] long lEngine,[in] long iMinQuality,[out, retval] long *result) |
Set the min. Match rate for the specified verfication engine. | |
HRESULT | SetMaximumResolution ([in] long iMaximumResolution,[out, retval] long *result) |
Set the maximum Resolution for signature and reference which are passed to the engines. | |
HRESULT | SetMode ([in] long iMode,[out, retval] long *result) |
Set the compare mode. | |
HRESULT | SetStaticMatchQuality ([in] long iMinStaticQuality,[out, retval] long *result) |
Set the min. Match rate for static verfication. | |
HRESULT | SetTicket ([in] ISPTicket *pTicket,[out, retval] long *result) |
Pass charged ticket for a compare operation. |
Member Function Documentation
|
compare a signature with a static image
|
|
compare a signature with a reference
|
|
compare a static signature with a static reference
|
|
compare a static signature with a reference
|
|
compare a static signature with a template
|
|
compare a signature with a template
|
|
Create the comppare instance.
|
|
Get the result for the specified engine.
|
|
Get the min. Match rate for dynamic verfication.
|
|
Get the result of a dynamic comparison.
|
|
Get the min. Match rate for static and dynamic verfication.
|
|
Get the min. Match rate for the specified verfication.
|
|
Get the compare mode.
|
|
Query the number of available results for the specified engine.
|
|
Get the final result of a comparison.
|
|
Get the min. Match rate for static verfication.
|
|
Get the result of a static comparison.
|
|
Set the min. Match rate for sdynamic verfication.
|
|
Set the min. Match rate for static and dynamic verfication.
|
|
Set the min. Match rate for the specified verfication engine.
|
|
Set the maximum Resolution for signature and reference which are passed to the engines. The default maximum resolution is 300 DPI. This parameter will be ignored if the flag SPX_COMPARE_AUTOZOOM is not set If maximum resolution is set to 0 and flag SPX_COMPARE_AUTOZOOM is set, then signature and reference will be resized to the lower resolution of signature and reference.
|
|
Set the compare mode.
|
|
Set the min. Match rate for static verfication.
|
|
Pass charged ticket for a compare operation.
|
The documentation for this interface was generated from the following file: