IBM Books

Image, Audio, and Video Extenders Administration and Programming

QbScoreTBFromName


Image Audio Video
X    

Returns a table of scores for an image column. Each score is a number that expresses how closely the features of the image match those of the query object. The QBIC catalog that is associated with the specified table and column to which the image handle belongs is used to calculate the score of each image. The lower the score for any image, the more closely the features of that image match those of the query object.

Notes:

  1. EEE Only: QbScoreTBFromName is not supported in a partitioned database environment. Use the the QbScoreFromStr UDF instead, after using the QbQueryGetString API to get the query string.

  2. QbScoreTBFromName will be deprecated in the future for non-partitioned database environments. To reuse a query, you should use the QbQueryGetString API to get the query string and save that string for later use in your application.

Include file

none

Syntax

Return scores for all cataloged images in a column

>>-QbScoreTBFromName--(--queryName--,--table--,--column--)-----><
 

Syntax

Return scores for a specific number of cataloged images in a column

>>-QbScoreTBFromName--(--queryName--,--table--,--column--,------>
 
>----maxReturns--)---------------------------------------------><
 

Parameters (data type)

queryName (VARCHAR(18))
The name of the query object.

table (CHAR(18))
The qualified name of the table that contains the image column. You can use an unqualified table name if the table schema is the same as the user ID used to start DB2 extenders services.

column (CHAR(18))
The name of the image column.

maxReturns (INTEGER)
The maximum number of handles that the table of results is to return. If a value is not specified, the maximum number of handles that are returned is 100.

Return values (data type)

Table of image handles and scores for the images in the column. The result table has two columns: IMAGE_ID (DB2Image) which contains the image handles, and SCORE (DOUBLE) which contains the scores. The result table is arranged in ascending order by score. The score can range from 0.0 to a very large number approaching infinity. The lower the score, the closer the feature values of the target image match the feature values specified in the query. A score of 0.0 means an exact match. A score of -1 means that the image has not been cataloged.

Examples

Compare the texture of the images in a table column to the texture that is specified in a query object; return the image handles and their scores:

 SELECT name, description
 INTO :hvName, :hvDesc
 FROM fabric
 WHERE CAST (swatch_img as varchar(250)) IN 
  (SELECT CAST (image_id as varchar(250)) FROM TABLE
  (QbScoreTBFromName
      'fstxtr',
      'clothes.fabric',
      'swatch_img'))
  AS T1));           


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]