Oracle® interMedia Reference 10g Release 1 (10.1) Part Number B10829-01 |
|
|
View PDF |
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_TextureEncoding: a varray that represents the image texture characteristics such as coarseness, contrast, and directionality.
This section describes the SI_Texture object constructor, which is as follows:
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
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:
The value of specified image is NULL.
The value of sourceImage.SI_Content is NULL.
The texture feature is not supported for the format of the specified image. This is determined by looking up the SI_IMAGE_FORMAT_FEATURES view or SI_IMAGE_FRMT_FTRS view.
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; /
This section presents reference information on the SI_Texture method used for image matching, which is as follows:
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:
The value of the SI_Texture object to which you apply this method is NULL.
The value of the specified image is NULL.
The value of image.SI_Contents is NULL.
The texture feature is not supported for the specified image.
Parameters
The feature value to be compared with the texture of the specified 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; /