Oracle interMedia Java Classes API Reference
10g Release 2 (10.2)

Part No. B14301-01


oracle.ord.im
Class OrdImageSignature

java.lang.Object
  extended byoracle.ord.im.OrdImageSignatureBase
      extended byoracle.ord.im.OrdImageSignature

All Implemented Interfaces:
oracle.sql.CustomDatum, oracle.sql.CustomDatumFactory, oracle.jdbc.internal.ObjectData, oracle.jdbc.internal.ObjectDataFactory, oracle.sql.ORAData

public class OrdImageSignature
extends oracle.ord.im.OrdImageSignatureBase

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, as well as static methods to compare two image signatures.

Users of this class should be familiar with Oracle interMedia Reference.

If your application modifies the OrdImageSignature Java object, you must perform a SQL update operation to make those changes permanent.

Image signature indexes are used to improve the performance of database operations involving image matching. To take advantage of the increased performance that is possible using image matching with image signature indexes on the underlying tables, use the IMGSimilar and IMGScore SQL operators.

See Oracle interMedia Reference for more information about image signature indexes.

Note
All interMedia features are available with the Standard Edition of Oracle Database, except image indexing, which uses the ORDImageSignature object. The image indexing feature requires bit-mapped indexing, which is available only when you install the Enterprise Edition of Oracle Database.
Prerequisites

In order to run OrdImageSignature methods, you will need to include the following import statements in your Java file:

 import oracle.ord.im.OrdMediaUtil;
 import oracle.ord.im.OrdImageSignature; 

You may also need to import classes from the following Java packages:

 java.io.
 java.sql. 
 oracle.jdbc.

Before running OrdImageSignature methods, the following operations must have already been performed:

For examples of making a connection and populating a local object, see Oracle interMedia User's Guide.


Field Summary

Fields inherited from class oracle.ord.im.OrdImageSignatureBase
_SQL_NAME, _SQL_TYPECODE

Constructor Summary
OrdImageSignature()
Deprecated.

Method Summary
oracle.sql.CustomDatum create(oracle.sql.Datum d, int sqlType)
Exists as an 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. New applications should use the getORADataFactory method.
static oracle.sql.ORADataFactory getORADataFactory()
Returns the OrdImageSignature ORADataFactory interface 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.

Methods inherited from class oracle.ord.im.OrdImageSignatureBase
create, toDatum, toDatum

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OrdImageSignature

public OrdImageSignature()
Deprecated.
Exists as an 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: color, shape, texture, location.

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
Note
The ORDImageSignature evaluateScore method operates on two image signatures, not on indexes on database tables. Therefore, this method 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 Reference for more information about image signature indexes.

Parameters:
signature1 - the first 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 floating-point value (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: color, shape, texture, location.

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
Note
The ORDImageSignature isSimilar method operates on two image signatures, not on indexes on database tables. Therefore, this method 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 Reference for more information about image signature indexes.

Parameters:
signature1 - the first 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 floating-point value (float) that specifies the degree of similarity required for the two images to be considered a match.
Returns:
an integer (int) value of 1 if the images match; otherwise, it returns 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 interface for use by the getORAData method. Specify the getORADataFactory method as the factory parameter of the getORAData method when retrieving an OrdImageSignature object from an OracleResultSet or OracleCallableStatement object.
Returns:
the OrdImageSignature implementation of the ORADataFactory interface.

getFactory

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

create

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

Oracle interMedia Java Classes API Reference
10g Release 2 (10.2)

Part No. B14301-01


Copyright © 1999, 2005, Oracle. All rights reserved.