Oracle interMedia Java Classes User's Guide and Reference
Release 9.0.1

Part Number A88785-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

6
OrdImageSignature Reference Information

This chapter describes the OrdImageSignature object type.

6.1 Prerequisites

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:

6.2 Reference Information

This section presents reference information on the methods that operate on OrdImageSignature objects.


evaluateScore( )

Format

public static float evaluateScore(OrdImageSignature signature1, OrdImageSignature signature2,
String attrWeights, OracleConnection connection)

Description

Compares the image signature stored in signature1 to the signature stored in signature2 using the weights stored in attrWeights.

Parameters

signature1

The first signature.

signature2

The second signature, which will be compared to signature1.

attrWeights

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:

Attribute  Description 

color 

The weight value assigned to the color visual attribute.
Data type is String.
Default is 0.0. 

location 

The weight value assigned to the location visual attribute.
Data type is String.
Default is 0.0. 

shape 

The weight value assigned to the shape visual attribute.
Data type is String.
Default is 0.0. 

texture 

The weight value assigned to the texture visual attribute.
Data type is String.
Default is 0.0. 

connection

An object that represents the connection to the database.

Return Value

This method returns the score, which is a value between 0.0 and 100.0.

Exceptions

java.sql.SQLException

Example

float score = matchObj.evaluateScore(signature1, signature2, "color=1.0",
     connection);

where:


generateSignature( )

Format

public void generateSignature(OrdImage img)

Description

Generates a signature for a given input image.

Parameters

img

The image object whose signature is to be generated.

Return Value

None.

Exceptions

SQLException

Example

matchObj.generateSignature(imgObj);

where:


isSimilar( )

Format

public static int isSimilar(OrdImageSignature signature1, OrdImageSignature signature2,
String attrWeights, float threshold, OracleConnection connection)

Description

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.

Parameters

signature1

The first signature.

signature2

The second signature, which will be compared to signature1.

attrWeights

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:

Attribute  Description 

color 

The weight value assigned to the color visual attribute.
Data type is String.
Default is 0.0. 

location 

The weight value assigned to the location visual attribute.
Data type is String.
Default is 0.0. 

shape 

The weight value assigned to the shape visual attribute.
Data type is String.
Default is 0.0. 

texture 

The weight value assigned to the texture visual attribute.
Data type is String.
Default is 0.0. 

threshold

The value that the score must be less than to be considered a match.

connection

An object that represents the connection to the database.

Return Value

This method returns 1 if the images match; otherwise, this method returns 0.

Exceptions

java.sql.SQLException

Example

int i = matchObj.isSimilar(signature1, signature2, "color=0.5,shape=0.5", 10, 
     connection);

where:


Go to previous page Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback