Oracle8i Visual Information Retrieval Java Client User's Guide and Reference Release 8.1.5 A67300-01 |
|
The Oracle8i Visual Information Retrieval Java Client class library contains information about the OrdVir object type:
The OrdVir object type and class library are based on the OrdImage object type, which are, in turn, based on the OrdMultiMedia object type. OrdMultiMedia contains the OrdSource object type. This guide describes only information unique to the Visual Information Retrieval product. Any inherited methods or other characteristics are discussed in their own documentation.
The Oracle8i interMedia Audio, Image, and Video Java Client User's Guide and Reference describes the OrdImage, OrdMultiMedia, and OrdSource object types.
The OrdVir object type supports the storage and management of image data.
This object type is defined by Oracle8i Visual Information Retrieval as follows:
package oracle.ord.media; import java.sql.*; import java.io.*; import oracle.jdbc.driver.*; import oracle.sql.*; import oracle.ord.media.*; public class OrdVir extends OrdImage { // OrdVir class attribute byte[] signature; // OrdVir Default Constructor public OrdVir() {} public OrdVir(Connection connection) { } int bindInSQLParams(int start, OracleCallableStatement stmt) throws SQLException { } String defineSQLResults(String var) { } int declareSQLResults(int start, OracleCallableStatement stmt) throws SQLException { } String setSQLParams(String var) { } int getSQLResults(int start, OracleCallableStatement stmt) throws SQLException { } String getMediaType() { } String getFormatStr() { } String getUpdStr() { } String getSourceStr() { } String getContentLengthAPI() { } public void refresh(boolean forUpdate) throws SQLException { } public void flush() throws SQLException { } public void analyze() throws SQLException { } public int similar(byte [] signature2, String attrWeights, float threshold) throws SQLException { } public float score(byte [] signature2, String attrWeights) throws SQLException { } public int convert(String operations) throws SQLException { } // Vir Operators: public static int similar(byte [] signature1, byte [] signature2, String attrWeights, float threshold, Connection connection) throws SQLException { } public static float score(byte [] signature1, byte [] signature2, String attrWeights, Connection connection) throws SQLException { } public static int convert(byte [] signature, String operations,
Connection connection) throws SQLException { } // Accessor functions for local OrdVir attributes public byte[] getSignature() throws SQLException { } public void setSignature(byte[] value) throws SQLException { } }
Where the base image attributes included from OrdImage.java are defined as follows:
Three additional attributes of special note are defined in the included files, oracle.ord.media.*:
See Oracle8i interMedia Audio, Image, and Video Java Client User's Guide and Reference for information about the oracle.ord.media.* files and the OrdMultiMedia abstract class.
This section presents OrdVir reference information on the methods used for image data manipulation.
The OrdVir methods are described in the following groupings:
The following methods are inherited through the OrdMultiMedia package. See Oracle8i interMedia Audio, Image, and Video Java Client User's Guide and Reference for further information on these methods.
This section presents reference information on the OrdVir methods associated directly with visual information retrieval.
The methods described in this chapter show examples based on the instantiation of an OrdVir object. For the examples in this section, please consult the following Java code:
import oracle.ord.media.mediaClass; public class clientProgram { public static void main(String[] args){ The code in the examples should be placed here. } }
In each example, the parameter connection is a connection to an Oracle8i database.
public void analyze( ) throws SQLException
public
Sets the value for both the server- and client-side signature attributes based on the image data.
None.
None.
java.sql.SQLException
try{ OrdVir imageObj = new OrdVir (connection); . . . imageObj.analyze(); } catch(SQLException e){ . . . }
public int convert(string operations) throws SQLException
public
Converts the server-side signature data to a format usable on the database server (host) machine.
The type of processing done to the image signature. The following operations are available:
None.
java.sql.SQLException
When the operation is BYTEORDER, the signature is converted to the format of the host machine regardless of its initial state.
This method is useful if your signature data was created on a system with a different byte order than the system to which you are currently bound (the system where you intend to perform similar( ) and score( ) operations). If your host machine is from Sun Microsystems, Inc., the Convert( ) operator sets the signature to the big endian byte order. On an Intel Corporation machine, the operator converts the signature to the little endian byte order. Note that the images themselves are system-independent; only the signatures need to be converted.
When the operator is VIISAGE, the signature is converted from the format used by Viisage Technology for facial image recognition to the format usable by this product for score and similar operations.
try{ OrdVir imageObj = new OrdVir (connection); . . . ImageObj.convert("BYTEORDER"); } catch(SQLException e){ . . . }
public static int convert(byte [] signature, string operations, connection connection ) throws SQLException
public
Converts the client-side signature data to a format usable on the host machine. This is a static function not within the context of a particular image object.
Unlike the non-static version of this function, the static function can directly operate on signature data without any instance of an OrdVir object.
The signature of the image, as created by the analyze( ) method or by Viisage software. Data type is RAW(2000).
The type of processing done to the image signature. The following operations are available:
An object representing a connection to the server.
None.
java.sql.SQLException
When the operation is BYTEORDER, the signature is converted to the format of the host machine regardless of its initial state.
If your host machine is from Sun Microsystems, Inc., the Convert( ) operator sets the signature to the big endian byte order. On an Intel Corporation machine, the operator converts the signature to the little endian byte order. Note that the images themselves are system-independent; only the signatures need to be converted.
When the operator is VIISAGE, the signature is converted from the format used by Viisage Technology for facial image recognition to the format usable by this product for score( ) and similar( ) operations.
try{ byte[] imgSignature = new byte[2000]; . . . OrdVir.convert(imgSignature,"BYTEORDER",connection); } catch(SQLException e){ . . . }
public float score(byte [] cmpSignature, string attrWeights) throws SQLException
public
Compares the client-side image signature of the current OrdVir object to the cmpSignature signature using the weights provided in attrWeights.
The signature of the comparison image.
A list of weights to apply to each visual attribute. Data type is VARCHAR2. The following attributes can be specified, with a value of 0.0 specifying no importance and a value of 1.0 specifying highest importance. You must specify a value greater than zero for at least one of the attributes. The facial attribute is not compatible with any other attributes.
A floating-point number between 0.0 and 100.0, representing the weighted sum of the distances between the visual attributes.
java.sql.SQLException
The connection string of the two image objects must be the same.
try{ byte signature2 = new byte[2000]; . . . float score= OrdVir.score(signature2, "localcolor=1.0",connection); } catch(SQLException e){ . . . }
public static float score(byte [] signature1, byte [] signature2, string attrWeights connection connection) throws SQLException
public
Compares two client-side image signatures using the weights provided in
attrWeights.
Unlike the non-static version of this function, the static function can directly operate on signature data without an instance of an OrdVir object.
The signatures of the two images.
A list of weights to apply to each visual attribute. Data type is VARCHAR2. The following attributes can be specified, with a value of 0.0 specifying no importance and a value of 1.0 specifying highest importance. You must specify a value greater than zero for at least one of the attributes. The facial attribute is not compatible with any other attributes
An object representing a connection to the server.
A floating-point number between 0.0 and 100.0, representing the weighted sum of the distances between the visual attributes.
java.sql.SQLException
The connection string of the two image objects must be the same.
try{ byte signature1 = new byte[2000]; byte signature2 = new byte[2000]; . . . float score= OrdVir.score(signature1,signature2,
"localcolor=1.0",connection); } catch(SQLException e){ . . . }
public int similar( byte [] cmpSignature, string attrWeights, float threshold) throws SQLException
public
Compares the current client-side image to a signature provided in cmpSignature, using the weights provided in attrWeights.
The signature of the image stored in cmpImg.
A list of weights to apply to each visual attribute. Data type is VARCHAR2. The following attributes can be specified, with a value of 0.0 specifying no importance and a value of 1.0 specifying highest importance. You must specify a value greater than zero for at least one of the attributes. The facial attribute is not compatible with any other attributes.
An object representing a connection to the server.
The threshold value with which the weighted sum of the distances is to be compared. If the weighted sum is less than or equal to the threshold value, the images are considered to match. The range of this parameter is from 0.0 to 100.0.
The result of the comparison. If the result is less than or equal to the threshold, this method returns 1. Otherwise, this method returns 0.
java.sql.SQLException
try{ OrdVir imageObj = new OrdVir (connection); byte signature2 = new byte[2000]; . . . int result = imageObj.similar(signature2, "localcolor=1.0",connection, 10); } catch(SQLException e){ . . . }
public static int similar( byte [] signature1, byte [] signature2, string attrWeights, float threshold connection connection) throws SQLException
public
Compares the two client-side image signatures using the weights provided in attrWeights.
Unlike the non-static version of this function, the static function can directly operate on signature data without an instance of an OrdVir object.
The signatures of the images to be compared.
A list of weights to apply to each visual attribute. Data type is VARCHAR2. The following attributes can be specified, with a value of 0.0 specifying no importance and a value of 1.0 specifying highest importance. You must specify a value greater than zero for at least one of the attributes. The facial attribute is not compatible with any other attributes.
The threshold value with which the weighted sum of the distances is to be compared. If the weighted sum is less than or equal to the threshold value, the images are considered to match. The range of this parameter is from 0.0 to 100.0.
An object representing a connection to the server.
The result of the comparison. If the result is less than or equal to the threshold, this method returns 1. Otherwise, this method returns 0.
java.sql.SQLException
try{ OrdVir imageObj = new OrdVir (connection); byte signature1 = new byte[2000]; byte signature2 = new byte[2000]; . . . int result = imageObj.similar(signature1, signature2,
"localcolor=1.0",connection, 10); } catch(SQLException e){ . . . }
public byte [] getSignature( ) throws SQLException
public
Reads the signature of the OrdVir object stored on the client side.
None.
Returns the signature of the OrdVir object stored on the client side .
java.sql.SQLException
try{ OrdVir imageObj = new OrdVir (connection); . . . byte[] imgSignature = imageObj.getSignature(); } catch(SQLException e){ . . . }
public void setSignature(byte [] value) throws SQLException
public
Sets the signature field of the client OrdVir object. The signature value must be generated by either the analyze( ) method or Viisage software.
None.
None.
java.sql.SQLException
try{ OrdVir imageObj = new OrdVir (connection); byte[] imgSignature = new byte[2000]; . . . imageObj.setSignature(imgSignature); } catch(SQLException e){ . . . }
This section presents reference information on the OrdVir methods associated with the communication between the client and server.
The methods described in this section show examples based on the instantiation of an OrdVir object. For the examples in this section, please consult the following Java code:
import oracle.ord.media.mediaClass; public class clientProgram { public static void main(String[] args){ The code in the examples should be placed here. } }
In each example, the parameter connection is a connection to an Oracle8i database.
public void flush() throws SQLException
public
Sends information from the client-side OrdVir object to the server-side OrdVir object.
None.
None.
java.sql.SQLException
try{ OrdVir imageObj = new OrdVir(connection); . . . imageObj.flush(); } catch(SQLException e){ . . . }
public void refresh(boolean forUpdate) throws SQLException
public
Sends information from the server-side OrdVir object to the client-side OrdVir object with or without locking the database row.
Indicates whether or not the option is selected to be updated. It is set to true if it is selected to be updated; false otherwise.
None.
java.sql.SQLException
try{ OrdVir imageObj = new OrdVir(connection); . . . imageObj.refresh(false); } catch(SQLException e){ . . . }
where: