Skip Headers

Oracle® interMedia Reference
10g Release 1 (10.1)

Part Number B10829-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

SI_Texture Object Type

Describes the image texture characteristics by the size of repeating items (coarseness), brightness variations (contrast), and predominant direction (directionality). This object type is created in the ORDSYS schema with invoker rights. It is declared as an INSTANTIABLE and NOT FINAL type. (See "Internal Helper Types" for the textureEncoding attribute syntax.)


Note:

Use the SI_Texture constructor and method rather than accessing attributes directly to protect yourself from changes to the internal representation of the SI_Texture object.

The SI_Texture object is described as follows:

CREATE OR REPLACE TYPE SI_Texture
  AUTHID CURRENT_USER
  AS OBJECT
  (
     --attributes
     SI_TextureEncoding  textureEncoding,
     --Methods
     CONSTRUCTOR FUNCTION SI_Texture
     (sourceImage IN SI_StillImage)
     RETURN SELF AS RESULT DETERMINISTIC,
     --
     MEMBER FUNCTION SI_Score
      (SELF  IN SI_Texture,
       image IN SI_StillImage)
     RETURN DOUBLE PRECISION DETERMINISTIC
) INSTANTIABLE
  NOT FINAL;
/

where:


SI_Texture Constructor

This section describes the SI_Texture object constructor, which is as follows:

SI_Texture( )

Format

SI_Texture(sourceImage IN SI_StillImage)

RETURN SELF AS RESULT DETERMINISTIC;

Format of Equivalent SQL Function

SI_FindTexture(sourceImage IN SI_StillImage)

RETURN SI_Texture DETERMINISTIC;

Description

Constructs an SI_Texture object from the specified image.

Parameters

sourceImage

The image whose texture feature is being extracted.

Pragmas

None.

Exceptions

None.

Usage Notes

An error is returned if any of the following conditions is true:

Examples

Create an SI_Texture object using the SI_Texture( ) constructor:

DECLARE
   myTexture  SI_Texture;
   myimage    SI_StillImage;
BEGIN
  SELECT product_photo INTO myimage FROM pm.si_media 
   WHERE product_id=1 FOR UPDATE;
  myTexture := NEW SI_Texture(myimage);
  UPDATE pm.si_media SET texture = myTexture WHERE product_id=1;
  COMMIT;
END;
/

Create an SI_Texture object using the SI_FindTexture( ) function:

DECLARE
   myTexture  SI_Texture;
   myimage    SI_StillImage;
BEGIN
   SELECT product_photo INTO myimage FROM pm.si_media 
     WHERE product_id=2 FOR UPDATE;
   myTexture := SI_FindTexture(myimage);
   UPDATE pm.si_media SET texture = myTexture WHERE product_id=2;
   COMMIT;
END;
/

SI_Texture Method

This section presents reference information on the SI_Texture method used for image matching, which is as follows:

SI_Score( ) for SI_Texture

Format

SI_Score(image IN SI_StillImage) RETURN DOUBLE PRECISION DETERMINISTIC;

Format of Equivalent SQL Function

SI_ScoreByTexture(feature IN SI_Texture,

image IN SI_StillImage),

RETURN DOUBLE PRECISION DETERMINISTIC;

Description

Determines and returns the score of the specified image as compared to the SI_Texture object to which you are applying the method. The lower the returned value, the better the texture of the image is characterized by the SI_Texture value used for scoring the image. This method returns a DOUBLE PRECISION value between 0 and 100, unless any one of the following is true, in which case a NULL value is returned:

Parameters

feature

The feature value to be compared with the texture of the specified image.

image

The image whose texture feature is extracted and used for score comparison.

Usage Notes

None.

Pragmas

None.

Exceptions

None.

Examples

Compare an image to an SI_Texture object using the SI_Score( ) method and return the score:

DECLARE
    score DOUBLE PRECISION;
    myimage SI_StillImage;
    myTexture SI_Texture;
BEGIN
   SELECT texture INTO myTexture FROM pm.si_media 
      WHERE product_id=1;
   SELECT product_photo INTO myimage FROM pm.si_media 
      WHERE product_id=2;
   score := myTexture.SI_Score(myimage);
   DBMS_OUTPUT.PUT_LINE('Score is ' || score);
END;
/

Compare the texture of an image to an SI_Texture object using the
SI_ScoreByTexture( ) function and return the score:

DECLARE
    score DOUBLE PRECISION;
    myimage SI_StillImage;
    myTexture SI_Texture;
BEGIN
   SELECT texture INTO myTexture FROM pm.si_media 
      WHERE product_id=1;
   SELECT product_photo INTO myimage FROM pm.si_media 
      WHERE product_id=2;
   score := SI_ScoreByTexture(myTexture, myimage);
   DBMS_OUTPUT.PUT_LINE('Score is ' || score);
END;
/