Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
IEC 13249-5-04 (identical to CAN/CSA-ISO/IEC 13249-5-04) is part of the ISO/IEC 13249 series that extends the SQL standard with multimedia and application-specific packages. Part 5 specifically addresses still image data. The standard defines a set of SQL user‑defined types (UDTs), routines, and schemas that enable the storage, management, and retrieval of still images based on extracted visual features. It provides a standardized way to perform content‑based image retrieval and similarity comparison directly within SQL queries, without requiring external image analysis tools.
The standard defines several UDTs that are organized under the schema SQLMM_STILLIMAGE. Each UDT encapsulates image content and/or a specific visual feature. The following table summarizes the primary UDTs:
| UDT | Purpose | Key Attributes or Methods |
|---|---|---|
SI_StillImage | Represents a still image with content and optional feature data. | imageContent, imageFormat, imageType, height, width |
SI_AverageColor | Captures the average color of an image region. | colorSpace, red, green, blue, alpha |
SI_ColorHistogram | Describes the global colour distribution via a histogram. | colorSpace, bins, binValues |
SI_PositionalColor | Records colour at a specific spatial location. | xPosition, yPosition, colorValue |
SI_Texture | Encodes textural properties (coarseness, contrast, directionality). | coarseness, contrast, directionality |
SI_EdgeHistogram | Captures edge orientation distribution. | edgeAngles, frequencyArray |
Each UDT includes constructor functions, observer methods, and comparison routines. For example, an SI_StillImage object can be created from a BLOB or a file locator, and its features can be extracted using methods such as SI_StillImage::getAverageColor() and SI_StillImage::getColorHistogram().
The standard provides a set of SQL routines to compute visual features from raw image data. These routines include SI_GetAverageColor, SI_GetColorHistogram, SI_GetTexture, and SI_GetEdgeHistogram. The extracted feature objects expose a similarity() method that returns a score (typically between 0 and 1) indicating the likeness between two feature instances.
Example query pattern:
SELECT image_id, image_path FROM images WHERE image_data.SI_StillImage::getColorHistogram() .similarity(SI_ColorHistogram(:queryHistogram)) > 0.85 ORDER BY image_data.SI_StillImage::getColorHistogram() .similarity(SI_ColorHistogram(:queryHistogram)) DESC;
The standard supports common image formats such as JPEG, PNG, GIF, and TIFF. Image data can be stored directly as BLOB columns or referenced external files through SQL locators. The UDT SI_StillImage includes attributes for image format and type, allowing the DBMS to handle decoding and feature extraction transparently.
Feature extraction is computationally intensive. For large databases, it is advisable to compute features only once and store them alongside the images. Consider using partitioned tables and parallel index scans to accelerate similarity queries.
The UDTs and routines defined by IEC 13249-5-04 are designed to coexist with standard SQL data types. They can be used in SELECT, INSERT, UPDATE, and DELETE statements as well as in table creation and indexing. The standard also specifies conformance levels, allowing vendors to implement subsets.
Conformance to IEC 13249-5-04 requires implementation of all mandatory SQL statements, UDTs, and routines defined in the standard. Vendors may claim full conformance or may declare partial conformance if they implement only a subset of features (e.g., only colour‑based comparison without texture).
Testing suites for conformance are available through ISO/IEC published test assertions. Adoption of the standard remains limited; however, the architectural principles have influenced later SQL‑based multimedia extensions in several commercial databases.