Oracle interMedia Java Classes User's Guide and Reference Release 9.0.1 Part Number A88785-01 |
|
This chapter describes the OrdImageSignature object type.
You will need to include the following import statements in your Java file to run interMedia methods:
import java.sql.*; import java.io.*; import oracle.jdbc.driver.*; import oracle.sql.*; import oracle.ord.im.*;
The examples in this reference chapter are based on the assumption that the following operations have already been performed:
This section presents reference information on the methods that operate on OrdImageSignature objects.
public static float evaluateScore(OrdImageSignature signature1, OrdImageSignature signature2,
String attrWeights, OracleConnection connection)
Compares the image signature stored in signature1 to the signature stored in signature2 using the weights stored in attrWeights.
The first signature.
The second signature, which will be compared to signature1.
A list of weights to apply to each visual attribute. The attributes listed in the following table can be specified. You must specify a value greater than 0.0 for at least one of the following attributes: color, shape, and texture. There is no mandatory value to which the weights must total; however, it is recommended that you ensure that you are consistent with the total used in your application. The visual attributes are the following:
An object that represents the connection to the database.
This method returns the score, which is a value between 0.0 and 100.0.
java.sql.SQLException
float score = matchObj.evaluateScore(signature1, signature2, "color=1.0", connection);
where:
public void generateSignature(OrdImage img)
Generates a signature for a given input image.
The image object whose signature is to be generated.
None.
SQLException
matchObj.generateSignature(imgObj);
where:
public static int isSimilar(OrdImageSignature signature1, OrdImageSignature signature2,
String attrWeights, float threshold, OracleConnection connection)
Compares the image signatures in signature1 and signature2, using the weights provided. If the result of the comparison is less than or equal to the provided threshold, the images are considered a match.
The first signature.
The second signature, which will be compared to signature1.
A list of weights to apply to each visual attribute. The attributes listed in the following table can be specified. You must specify a value greater than 0.0 for at least one of the following attributes: color, shape, or texture. There is no mandatory value to which the weights must total; however, it is recommended that you ensure that you are consistent with the total used in your application. The visual attributes are the following:
The value that the score must be less than to be considered a match.
An object that represents the connection to the database.
This method returns 1 if the images match; otherwise, this method returns 0.
java.sql.SQLException
int i = matchObj.isSimilar(signature1, signature2, "color=0.5,shape=0.5", 10, connection);
where:
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|