Oracle interMedia Java Classes API Reference
10g Release 1 (10.1)

Part No. B12248-01

oracle.ord.im
Class OrdImageSignature

oracle.ord.im.OrdImageSignature

public class OrdImageSignature

The OrdImageSignature class is used to represent an instance of the ORDSYS.ORDImageSignature database type in a Java application. The OrdImageSignature class includes a method to generate an image signature, plus static methods to compare two image signatures.

Users of this class are assumed to be familiar with Oracle interMedia Java Classes User's Guide and Reference and Oracle interMedia User's Guide and Reference.

If your application modifies the OrdImageSignature Java object, you must update the OrdImageSignature SQL object in the database to make those changes permanent.

Note
The evaluateScore and isSimilar methods operate on two image signatures in the Java application, not on indexes on database tables. Therefore, they cannot take advantage of the increased performance that is possible using image matching with image signature indexes on the underlying tables. To use image signature indexes, use the IMGSimilar and IMGScore SQL operators. See Oracle interMedia User's Guide and Reference for more information.

Constructor Summary
OrdImageSignature()
          Internal constructor used only by the Oracle ORAData interface factory method to create an instance of the class.

 

Method Summary
 oracle.sql.CustomDatum create(oracle.sql.Datum d, int sqlType)
          Internal method used only by the Oracle CustomDatum interface.
static float evaluateScore(OrdImageSignature signature1, OrdImageSignature signature2, java.lang.String attrWeights)
          Compares two image signatures, returning a score that indicates the degree of difference between the image signatures.
 void generateSignature(OrdImage img)
          Generates an image signature for the specified image.
static oracle.sql.CustomDatumFactory getFactory()
          Deprecated. CustomDatumFactory method. New applications should use the ORADataFactory interface
static oracle.sql.ORADataFactory getORADataFactory()
          Returns the OrdImageSignature ORADataFactory for use by the getORAData method.
static int isSimilar(OrdImageSignature signature1, OrdImageSignature signature2, java.lang.String attrWeights, float threshold)
          Compares two image signatures, returning a status that indicates if the degree of difference between the image signatures is within a specified threshold.

 

Constructor Detail

OrdImageSignature

public OrdImageSignature()
Internal constructor used only by the Oracle ORAData interface factory method to create an instance of the class. Applications should not use this constructor.
Method Detail

generateSignature

public void generateSignature(OrdImage img)
                       throws java.sql.SQLException
Generates an image signature for the specified image.
Parameters:
img - an OrdImage object from which to generate the signature.
Throws:
java.sql.SQLException - if an error occurs calling the generateSignature method in the database.

evaluateScore

public static float evaluateScore(OrdImageSignature signature1,
OrdImageSignature signature2,
                                  java.lang.String attrWeights)
                           throws java.sql.SQLException
Compares two image signatures, returning a score that indicates the degree of difference between the image signatures. This method compares the image signatures in signature1 and signature2 using weights specified for one or more visual attributes. Returns a score between 0.0 and 100.0, where a lower value indicates a closer match.

Specify a weight in the range 0.0 to 1.0 for one or more of the following visual attributes:

You must specify a value greater than 0.0 for at least one of the following attributes: color, shape, or texture. The location attribute indicates the importance of the distribution of the color, shape or texture features in the images. During processing, the values are normalized such that they total 1.0.

For example, "color=0.7,shape=0.3".

Parameters:
signature1 - an OrdImageSignature.
signature2 - an OrdImageSignature to be compared to signature1.
attrWeights - a String that specifies a list of one or more visual attributes and the weight to be applied to each attribute.
Returns:
the score as a float.
Throws:
java.sql.SQLException - if an error occurs calling the evaluateScore method in the database.

isSimilar

public static int isSimilar(OrdImageSignature signature1,
OrdImageSignature signature2,
                            java.lang.String attrWeights,
                            float threshold)
                     throws java.sql.SQLException
Compares two image signatures, returning a status that indicates if the degree of difference between the image signatures is within a specified threshold. This method compares the image signatures in signature1 and signature2 using weights specified for one or more visual attributes. The result of the comparison is a score between 0.0 and 100.0, where a lower value indicates a closer match. If the score is less than or equal to the specified threshold, the images are considered a match and the method returns 1; otherwise, the method returns 0.

Specify a weight in the range 0.0 to 1.0 for one or more of the following visual attributes:

You must specify a value greater than 0.0 for at least one of the following attributes: color, shape, or texture. The location attribute indicates the importance of the distribution of the color, shape or texture features in the images. During processing, the values are normalized such that they total 1.0.

For example, "color=0.7,shape=0.3".

Parameters:
signature1 - an OrdImageSignature.
signature2 - an OrdImageSignature to be compared to signature1.
attrWeights - a String that specifies a list of one or more visual attributes and the weight to be applied to each attribute.
threshold - a float that specifies the degree of similarity required for the two images to be considered a match.
Returns:
an int value of 1 if the images match; otherwise, 0.
Throws:
java.sql.SQLException - if an error occurs calling the isSimilar method in the database.

getORADataFactory

public static oracle.sql.ORADataFactory getORADataFactory()
Returns the OrdImageSignature ORADataFactory for use by the getORAData method. Specify this method as the factory parameter of the getORAData method when retrieving an OrdImageSignature object from an OracleResultSet or OracleCallableStatement. For example:
  OrdImageSignature sig =
      (OrdImageSignature)rset.getORAData(
            1, OrdImageSignature.getORADataFactory() );
Returns:
the OrdImageSignature implementation of the ORADataFactory interface.

getFactory

public static oracle.sql.CustomDatumFactory getFactory()
Deprecated. CustomDatumFactory method. New applications should use the ORADataFactory interface

create

public oracle.sql.CustomDatum create(oracle.sql.Datum d,
                                     int sqlType)
                              throws java.sql.SQLException
Internal method used only by the Oracle CustomDatum interface. Applications should not call this method.

Oracle interMedia Java Classes API Reference
10g Release 1 (10.1)

Part No. B12248-01

Copyright © 1999, 2003, Oracle. All Rights Reserved.