visit Kofax web site

de.softpro.signware.SPCompare Class Reference

Inheritance diagram for de.softpro.signware.SPCompare:

de.softpro.signware.SPSignwareObject List of all members.

Detailed Description

Compare a SPSignature or SPImage object against a SPReference or SPTemplate or SPImage object.

SPCompare 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).
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 SPCompare 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

Operating Systems:
Windows (Win32)
// Example (Java)
class MyCompare
{  
    public int compare(SPReference aRef, SPSignature aSig, int iMode) throws SPSignwareException
    {
        SPCompare spCompare = new SPCompare();
        if((iMode & SPCompare.SP_COMPARE_DYNAMIC) != 0) {
            int iSampleRateSig = aSig.getSampleRate();
            int iPressSig = aSig.getMaxPressure();
            SPSignature sig0 = new SPSignature(sRef, 0);
            int iSampleRateRef = sig0.getSampleRate();
            int iPressRef = sig0.getMaxPressure();
            int iNumSignos = aRef.getSignatureCount();
            if(iPressSig <= 2 || iPressRef <= 2 || iSampleRateSig == 0 || iSampleRateRef == 0 || iNumSignos < 2) {
                iMode &= ~SPCompare.SP_COMPARE_DYNAMIC;
                iMode |= SPCompare.SP_COMPARE_DSTAT;
            }
        }
        spCompare.setMode(iMode);
        spCompare.compareReference(aRef, aSig);
  
        // Dump detailed results
        getDetailResult(spCompare, SPCompare.SP_COMPARE_STATIC_ENGINE, "static");
        getDetailResult(spCompare, SPCompare.SP_COMPARE_DYNAMIC_ENGINE, "dynamic");
        getDetailResult(spCompare, SPCompare.SP_COMPARE_DSTAT_ENGINE, "statistic");
  
        // Return the final result as computed by the SPCompare object
        return spCompare.getResult();
    }
  
    private void getDetailResult(SPCompare spCompare, int iEngine, String strEngine)
    {
        String strRes = "";
        try {
            int iNumResults = spCompare.getNumResults(iEngine);
            if(iNumResults > 0) {
                for(int ix = 0; ix < iNumResults; ix++) {
                    int iMatch = spCompare.getDetailResult(iEngine, ix);
                    if(iMatch < 0) {
                        // an error occured
                        strRes += strEngine + "[" + ix + "]: " + iMatch + ", " + SPSignware.getErrorString(iMatch) + "\n";
                    } else {
                        strRes += strEngine + "[" + ix + "]: " + iMatch + "\n";
                    }
                }
            }
        } catch (SPSignwareException se) {
            System.out.println("getDetailResult() - " + se.getMessage());
        }
        System.out.println(strRes);
    }
  
}  


Public Member Functions

void compareImage (SPImage pImage, SPImage pSignature) throws SPSignwareException
 compare a signature with an Image
void compareImage (SPImage pImage, SPSignature pSignature) throws SPSignwareException
 compare a signature with an Image
void compareReference (SPReference pReference, SPImage pImage) throws SPSignwareException
 compare a signature with a reference
void compareReference (SPReference pReference, SPSignature pSignature) throws SPSignwareException
 compare a signature with a reference
void compareTemplate (SPTemplate pTemplate, SPImage pImage) throws SPSignwareException
 compare a signature with a template
void compareTemplate (SPTemplate pTemplate, SPSignature pSignature) throws SPSignwareException
 compare a signature with a template
int getDetailResult (int iEngine, int iIndex) throws SPSignwareException
 Get the result for the specified engine.
int getDynamicMatchQuality () throws SPSignwareException
 Get the min. Match rate for dynamic verfication.
int getDynamicResult () throws SPSignwareException
 Get the result of a dynamic comparison.
int getMatchQualityEx (int iEngine) throws SPSignwareException
 Get the min. Match rate for the specified engine.
int getMode () throws SPSignwareException
 Get the compare mode.
int getNumResults (int iEngine) throws SPSignwareException
 Get the number of available results for the specified engine.
int getNumStaticResults () throws SPSignwareException
 Query the number of statics results available.
int getResult () throws SPSignwareException
 Get the final result of a comparison.
int getStaticMatchQuality () throws SPSignwareException
 Get the min. Match rate for static verfication.
int getStaticResult (int iIndex) throws SPSignwareException
 Get the result of a static comparison.
void setDynamicMatchQuality (int iMinDynamicQuality) throws SPSignwareException
 Set the min. Match rate for sdynamic verfication.
void setMatchQuality (int iMinDynamicQuality, int iMinStaticQuality) throws SPSignwareException
 Set the min. Match rate for static and dynamic verfication.
void setMatchQualityEx (int iEngine, int iMatchRate) throws SPSignwareException
 Set the min. Match rate for the specified engine.
void setMaximumResolution (int iMaximumResolution) throws SPSignwareException
 Set the maximum Resolution for signature and reference which are passed to the engines.
void setMode (int iMode) throws SPSignwareException
 Set the compare mode.
void setStaticMatchQuality (int iMinStaticQuality) throws SPSignwareException
 Set the min. Match rate for static verfication.
void setTicket (SPTicket spTicket) throws SPSignwareException
 Pass a license for one or more compares or SPTicket.ticket_compare_dynamic).
 SPCompare () throws SPSignwareException
 Create a Compare data structure.

Static Public Attributes

static final int SP_COMPARE_AUTO_ENGINE = 0x80
 Flag to use all engines available for the according compare objects.
static final int SP_COMPARE_AUTOZOOM = 0x20
 Flag to size the projected signature / reference images for compares.
static final int SP_COMPARE_DESKEW = 4
 Flag to deskew signature and reference / template.
static final int SP_COMPARE_DSTAT = 0x40
 Flag to include a dstat (statistic) comparison.
static final int SP_COMPARE_DSTAT_ENGINE = 1
 Engine specifyer: use dstat (statistic) engine.
static final int SP_COMPARE_DYNAMIC = 2
 Flag to include a dynamic comparison.
static final int SP_COMPARE_DYNAMIC_ENGINE = 2
 Engine specifyer: use dynamic (adsv) engine.
static final int SP_COMPARE_MIRROR = 0x10
 Flag to compare signatures and references / templates that are written from right to left.
static final int SP_COMPARE_NORMALIZE_SAMPLERATE = 8
 Flag to normalize the sample rate of signature and reference or template.
static final int SP_COMPARE_STATIC = 1
 Flag to include a static comparison.
static final int SP_COMPARE_STATIC_ENGINE = 3
 Engine specifyer: use static (sival) engine.

Package Functions

final native int jniFree ()


Constructor & Destructor Documentation

de.softpro.signware.SPCompare.SPCompare  )  throws SPSignwareException
 

Create a Compare data structure.

The default mode is set to SP_COMPARE_STATIC | SP_COMPARE_DYNAMIC | SP_COMPARE_DESKEW.

Operating Systems:
Windows (Win32)
See also:
SPCompareCreate


Member Function Documentation

void de.softpro.signware.SPCompare.compareImage SPImage  pImage,
SPImage  pSignature
throws SPSignwareException
 

compare a signature with an Image

Note:
Call getCompareResult or getDetailResult to query the compare result.

the final result will alays be 'no match' if the compare modes include SP_COMPARE_DYNAMIC or SP_COMPARE_DSTAT

Parameters:
pImage [i] pointer to a valid image object
pSignature [i] pointer to a valid image object
Operating Systems:
Windows (Win32)
See also:
SPCompareTemplate, SPCompareReference

setMode

void de.softpro.signware.SPCompare.compareImage SPImage  pImage,
SPSignature  pSignature
throws SPSignwareException
 

compare a signature with an Image

Note:
Call getCompareResult or getDetailResult to query the compare result.

the final result will alays be 'no match' if the compare modes include SP_COMPARE_DYNAMIC or SP_COMPARE_DSTAT

Parameters:
pImage [i] pointer to a valid image object
pSignature [i] pointer to a valid signature object
Operating Systems:
Windows (Win32)
See also:
SPCompareTemplate, SPCompareReference

setMode

void de.softpro.signware.SPCompare.compareReference SPReference  pReference,
SPImage  pImage
throws SPSignwareException
 

compare a signature with a reference

Note:
Call getCompareResult or getDetailResult to query the compare result.

the final result will alays be 'no match' if the compare modes include SP_COMPARE_DYNAMIC or SP_COMPARE_DSTAT

Parameters:
pReference [i] pointer to a valid reference object
pImage [i] pointer to a valid image object
Operating Systems:
Windows (Win32)
See also:
SPCompareReference, SPCompareImage

setMode

void de.softpro.signware.SPCompare.compareReference SPReference  pReference,
SPSignature  pSignature
throws SPSignwareException
 

compare a signature with a reference

Note:
Call getCompareResult or getDetailResult to query the compare result.

the final result will alays be 'no match' if the compare modes include SP_COMPARE_DYNAMIC and signature or reference were capture with less than three pressure levels or at non equidistant time intervals, or the reference contains one signature.

Parameters:
pReference [i] pointer to a valid reference object
pSignature [i] pointer to a valid signature object
Operating Systems:
Windows (Win32)
See also:
SPCompareReference, SPCompareImage

setMode

void de.softpro.signware.SPCompare.compareTemplate SPTemplate  pTemplate,
SPImage  pImage
throws SPSignwareException
 

compare a signature with a template

Note:
Call getCompareResult or getDetailResult to query the compare result.

the final result will alays be 'no match' if the compare modes include SP_COMPARE_DYNAMIC or SP_COMPARE_DSTAT

Parameters:
pTemplate [i] pointer to a valid template object
pImage [i] pointer to a valid image object
Operating Systems:
Windows (Win32)
See also:
SPCompareTemplate, SPCompareImage

setMode

void de.softpro.signware.SPCompare.compareTemplate SPTemplate  pTemplate,
SPSignature  pSignature
throws SPSignwareException
 

compare a signature with a template

Note:
Call getCompareResult or getDetailResult to query the compare result.

the final result will alays be 'no match' if the compare modes include SP_COMPARE_DSTAT

Parameters:
pTemplate [i] pointer to a valid template object
pSignature [i] pointer to a valid signature object
Operating Systems:
Windows (Win32)
See also:
SPCompareTemplate, SPCompareImage

setMode

int de.softpro.signware.SPCompare.getDetailResult int  iEngine,
int  iIndex
throws SPSignwareException
 

Get the result for the specified engine.

Parameters:
iEngine [i] specify the engine, one of the following:
iIndex [i] zero based index, call getNumResults to query the number of available results for an engine
Returns:
int the detailed compare result. The result may be:
  • SP_INVALIDERR : The engine was not called
  • SP_UNSUPPORTEDERR : An attempt was made to call the engine with wrong data (e. g. dynmic engine with static image)
  • < 0 An error occured
  • 0 ... 100 the match rate
Exceptions:
SPSignwareException 
Operating Systems:
Windows (Win32)
See also:
SPCompareGetDetailResult
Since:
SPSignware Version 3.2.1

int de.softpro.signware.SPCompare.getDynamicMatchQuality  )  throws SPSignwareException
 

Get the min. Match rate for dynamic verfication.

Returns:
int the actual min. dynamic match rate
Exceptions:
SPSignwareException 
Operating Systems:
Windows (Win32)
See also:
SPCompareGetDynamicMatchRate
Deprecated:
Use de.softpro.signware.SPCompare.getMatchQualityEx

int de.softpro.signware.SPCompare.getDynamicResult  )  throws SPSignwareException
 

Get the result of a dynamic comparison.

Returns:
int the ddynamic compare result. The result may be:
  • SP_INVALIDERR : The engine was not called
  • SP_UNSUPPORTEDERR : An attempt was made to call the engine with wrong data (e. g. dynmic engine with static image)
  • < 0 An error occured
  • 0 ... 100 the match rate
Operating Systems:
Windows (Win32)
See also:
SPCompareGetDynamicResult, compareReference, compareTemplate
Deprecated:
Use de.softpro.signware.SPCompare.getDetailResult

int de.softpro.signware.SPCompare.getMatchQualityEx int  iEngine  )  throws SPSignwareException
 

Get the min. Match rate for the specified engine.

Parameters:
iEngine [i] specify the engine, one of the following:
Returns:
int the actual minimum match rate
Exceptions:
SPSignwareException 
Operating Systems:
Windows (Win32)
See also:
SPCompareGetMatchRateEx, setMatchQualityEx
Since:
SPSignware Version 3.2.1

int de.softpro.signware.SPCompare.getMode  )  throws SPSignwareException
 

Get the compare mode.

Returns:
int the actual compare mode, a combination of the values
Operating Systems:
Windows (Win32)
See also:
SP_COMPARE_STATIC, SP_COMPARE_DYNAMIC, SP_COMPARE_DESKEW

SPCompareGetMode

int de.softpro.signware.SPCompare.getNumResults int  iEngine  )  throws SPSignwareException
 

Get the number of available results for the specified engine.

Parameters:
iEngine [i] specify the engine, one of the following:
Returns:
int number of availabel results
Exceptions:
SPSignwareException 
Operating Systems:
Windows (Win32)
See also:
SPCompareGetNumResults
Since:
SPSignware Version 3.2.1

int de.softpro.signware.SPCompare.getNumStaticResults  )  throws SPSignwareException
 

Query the number of statics results available.

Returns:
int the number of static results
See also:
SPCompareGetNumStaticResults
Deprecated:
Use de.softpro.signware.SPCompare.getNumResults

int de.softpro.signware.SPCompare.getResult  )  throws SPSignwareException
 

Get the final result of a comparison.

Returns:
int the final result:
  • -1: Result not computed
    • 0: No match, signature and reference / template are not similar
    • 1: Match, signature and reference / template are similar
Operating Systems:
Windows (Win32)
See also:
compareReference, compareTemplate

SPCompareGetResult

int de.softpro.signware.SPCompare.getStaticMatchQuality  )  throws SPSignwareException
 

Get the min. Match rate for static verfication.

Returns:
int the actual min. static match rate
Exceptions:
SPSignwareException 
Operating Systems:
Windows (Win32)
See also:
SPCompareGetDStaticMatchRate
Deprecated:
Use de.softpro.signware.SPCompare.getMatchQualityEx

int de.softpro.signware.SPCompare.getStaticResult int  iIndex  )  throws SPSignwareException
 

Get the result of a static comparison.

The threshold for a match is typically set at a matchrate of 80.

Static comparison is called for each signature of the reference. The result of each comparison is accessible via parameter iIndex. Please pass iIndex = 0 for the first comparison.
Templates only contain one signature, resulting in one comparison.

Parameters:
iIndex [i] index to address which static comparison result to return.
Returns:
int the static result:
  • SP_INVALIDERR : The engine was not called
  • < 0 An error occured
  • 0 .. 100: Matchrate, a measure for similarity of signature and reference / template, 0 not similar, 100 similar
Operating Systems:
Windows (Win32)
See also:
SPCompareGetStaticResult, compareReference, compareTemplate
Deprecated:
Use de.softpro.signware.SPCompare.getDetailResult

final native int de.softpro.signware.SPCompare.jniFree  )  [package, virtual]
 

Implements de.softpro.signware.SPSignwareObject.

void de.softpro.signware.SPCompare.setDynamicMatchQuality int  iMinDynamicQuality  )  throws SPSignwareException
 

Set the min. Match rate for sdynamic verfication.

Default valus for dynamic quality rates are 80. Values must be within 0 and 100.

Parameters:
iMinDynamicQuality [i] min match rate to calcurate a verification passed result
Operating Systems:
Windows (Win32)
See also:
SPCompareSetDynamicMatchQuality, getMatchQualityEx, setMatchQualityEx
Deprecated:
Use de.softpro.signware.SPCompare.setMatchQualityEx

void de.softpro.signware.SPCompare.setMatchQuality int  iMinDynamicQuality,
int  iMinStaticQuality
throws SPSignwareException
 

Set the min. Match rate for static and dynamic verfication.

Default values for static and dynamic quality rates are 80. Values must be within 0 and 100.

Parameters:
iMinDynamicQuality [i] min match rate to calcurate a verification result
iMinStaticQuality [i] min match rate to calcurate a verification result
Operating Systems:
Windows (Win32)
See also:
getResult

SPCompareSetMatchQuality

setMatchQualityEx, getMatchQualityEx

Deprecated:
Use de.softpro.signware.SPCompare.setMatchQualityEx

void de.softpro.signware.SPCompare.setMatchQualityEx int  iEngine,
int  iMatchRate
throws SPSignwareException
 

Set the min. Match rate for the specified engine.

Parameters:
iEngine [i] specify the engine, one of the following:
iMatchRate [i] the desired minimum match rate
Exceptions:
SPSignwareException 
Operating Systems:
Windows (Win32)
See also:
SPCompareSetMatchQualityEx
Since:
SPSignware Version 3.2.1

void de.softpro.signware.SPCompare.setMaximumResolution int  iMaximumResolution  )  throws SPSignwareException
 

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 SP_COMPARE_AUTOZOOM is not set

If maximum resolution is set to 0 and flag SP_COMPARE_AUTOZOOM is set, then signature and reference will be resized to the lower resolution of signature and reference.

Parameters:
iMaximumResolution [i] maximum resolution in DPI, set to 0 to disable a maximum resolution. The default value is 300 DPI.
Exceptions:
SPSignwareException 
Operating Systems:
Windows (Win32)
Since:
Version 3.2.2

void de.softpro.signware.SPCompare.setMode int  iMode  )  throws SPSignwareException
 

Set the compare mode.

The default mode is SP_COMPARE_DESKEW | SP_COMPARE_AUTOZOOM.

Note:
SP_COMPARE_AUTO_ENGINE may not be combined with SP_COMPARE_STATIC, SP_COMPARE_DSTAT or SP_COMPARE_DYNAMIC.
Parameters:
iMode [i] compare mode, a combination of the values
Operating Systems:
Windows (Win32)
See also:
compareReference, compareTemplate

SP_COMPARE_STATIC, SP_COMPARE_DYNAMIC, SP_COMPARE_DESKEW, SP_COMPARE_DSTAT, SP_COMPARE_AUTO_ENGINE, SP_COMPARE_MIRROR, SP_COMPARE_AUTOZOOM

SPCompareSetMode

void de.softpro.signware.SPCompare.setStaticMatchQuality int  iMinStaticQuality  )  throws SPSignwareException
 

Set the min. Match rate for static verfication.

Default valus for static quality rates is 80. Values must be within 0 and 100. *

Parameters:
iMinStaticQuality [i] min match rate to calcurate a verification passed result
Operating Systems:
Windows (Win32)
See also:
SPCompareSetStaticMatchQuality, setMatchQualityEx, getMatchQualityEx
Deprecated:
Use de.softpro.signware.SPCompare.setMatchQualityEx

void de.softpro.signware.SPCompare.setTicket SPTicket  spTicket  )  throws SPSignwareException
 

Pass a license for one or more compares or SPTicket.ticket_compare_dynamic).

The ticket must have been charged for usage SPTicket.ticket_compare_static or SPTicket.ticket_compare_dynamic.

Note:
You must pass the ticket before you call a compare method.
Deprecated:
Please use a license key.
Parameters:
spTicket [i] a valid and charged ticket
Exceptions:
SPSignwareException 
Operating Systems:
Windows (Win32)


Member Data Documentation

final int de.softpro.signware.SPCompare.SP_COMPARE_AUTO_ENGINE = 0x80 [static]
 

Flag to use all engines available for the according compare objects.

The compare functions will do a at least static comparison with the reference.
If signature and reference include dynamic data, and all signatures were captured on a device with equidistant sample rate and all signatures were captured on a device with more than 2 pressure levels then the compare functions will do a dynamic comparison.
If signature and reference include dynamic data, and one or more signatures were captured on a device with non equidistant sample rate or one or more signatures were captured on a device with 2 pressure levels then the compare functions will do a statistic comparison.

final int de.softpro.signware.SPCompare.SP_COMPARE_AUTOZOOM = 0x20 [static]
 

Flag to size the projected signature / reference images for compares.

The signature and reference will be resized to the lowest resolution value of signaure, reference and MaxResolution.

Note:
The resulting resizing factor of dynamic signatures will also consider the projection zoom factor

final int de.softpro.signware.SPCompare.SP_COMPARE_DESKEW = 4 [static]
 

Flag to deskew signature and reference / template.

The SPCompare-functions deskew signature and reference / template before calling a static comparison.
The flag is ignored, if SP_COMPARESTATIC is not set.

final int de.softpro.signware.SPCompare.SP_COMPARE_DSTAT = 0x40 [static]
 

Flag to include a dstat (statistic) comparison.

The SPCompare-function will do a dstat comparison with the reference.

final int de.softpro.signware.SPCompare.SP_COMPARE_DSTAT_ENGINE = 1 [static]
 

Engine specifyer: use dstat (statistic) engine.

See also:
getDetailResult, setMatchQuality(int, int), getMatchQuality(int)

final int de.softpro.signware.SPCompare.SP_COMPARE_DYNAMIC = 2 [static]
 

Flag to include a dynamic comparison.

The SPCompare-function will do a dynamic comparison with the reference or the template.

final int de.softpro.signware.SPCompare.SP_COMPARE_DYNAMIC_ENGINE = 2 [static]
 

Engine specifyer: use dynamic (adsv) engine.

final int de.softpro.signware.SPCompare.SP_COMPARE_MIRROR = 0x10 [static]
 

Flag to compare signatures and references / templates that are written from right to left.

Some nations write from right to left. This flag will optimize the static signature compare engine for signatures that were entered writing from left to right. The SPCompare-functions will mirror signature and reference / template before calling a static comparison.
The flag is ignored, if SP_COMPARESTATIC is not set.

final int de.softpro.signware.SPCompare.SP_COMPARE_NORMALIZE_SAMPLERATE = 8 [static]
 

Flag to normalize the sample rate of signature and reference or template.

The SPCompare-functions normalize the tablet sample rate of signature and reference or template before calling a static comparison.
The flag is ignored, if SP_COMPAREDYNAMIC is not set.

final int de.softpro.signware.SPCompare.SP_COMPARE_STATIC = 1 [static]
 

Flag to include a static comparison.

The SPCompare-function will do a static comparison of the signature with all reference signatures, or the template.

final int de.softpro.signware.SPCompare.SP_COMPARE_STATIC_ENGINE = 3 [static]
 

Engine specifyer: use static (sival) engine.


The documentation for this class was generated from the following file: