Oracle8 Visual Information Retrieval Cartridge User's Guide
Release 1.0.1






Prev Next


Oracle8 Visual Information Retrieval Cartridge is an extension to Oracle8 Enterprise Edition that provides image storage, content-based retrieval, and format conversion capabilities through an object data type (ODT). The capabilities of this cartridge encompass the storage, retrieval, and manipulation of image data managed by the Oracle8 Enterprise Edition universal data server. This cartridge supports image storage using binary large objects (BLOBs) and references to image data residing in external files (BFILEs).

Visual Information Retrieval Cartridge is a building block for various imaging applications rather than being an end-user application in itself. It consists of ODTs along with related methods for managing and processing image data. Some example applications for this cartridge are:

These applications have certain distinct requirements and some degree of commonality. The image ODTs accommodate the commonality and support extensions that address application-specific requirements. With Visual Information Retrieval Cartridge, images can be managed as easily as standard attribute data.

Visual Information Retrieval Cartridge supports static, two-dimensional images in Oracle databases. The images may be bitonal (black and white) document images, grayscale photographs, or three-color photographic images. The cartridge provides the means to add image columns/objects to existing tables, insert and retrieve images, and convert between popular application formats. This enables database designers to extend existing application databases with images or to build new end-user image database applications. Cartridge developers can use the basic functions provided here to build specialized image data cartridges.

1.1 If You Already Understand Oracle8 Image Cartridge

If you are already familiar with Oracle8 Image Cartridge, you can skim much of the conceptual information in this chapter. Image Cartridge and Visual Information Retrieval Cartridge both let you store an image as an object in the database or as a reference to an external file. Both cartridges let you store and query on the following attributes:

The main difference between the two cartridges is that Visual Information Retrieval Cartridge also lets you perform content-based retrieval, that is, to perform queries based on intrinsic visual attributes of the image (color, structure, texture) rather than being limited to keyword searches in textual annotations or descriptions. The underlying technology was developed by Virage, Inc., a leader in content-based retrieval.

For an example of a query using content-based retrieval, consider a database containing images of many automobiles. If you want to retrieve information on all the red automobiles, you would specify an image of a red automobile for comparison and request all records where the image looks like your picture. To increase the accuracy of the query (because all the images are of automobiles and you are interested only in red ones), you specify that the greatest relative weight is to be given to the global color attribute, with no weight given to the structure and texture attributes.

For further information on content-based retrieval, including how and why to specify relative weights (importance) for different visual attributes, see Chapter 2.

1.2 Data Cartridges

Within the Oracle Network Computing Architecture (NCA), data cartridges facilitate the storage and retrieval of complex data types required by nontraditional database applications, such as geographic information systems, imaging, workflow, document management, and digital libraries. These applications are built using components or modules that support the capture, input, processing, analysis, storage, retrieval, and display of the complex data types. Figure 1-1 shows the relationship between data cartridges and NCA.

A data cartridge is the mechanism by which clients, application-specific servers, and database servers can be easily and reliably extended. Visual Information Retrieval Cartridge plugs into Oracle8 Enterprise Edition and provides support for image domain-specific types, methods, and interfaces. The cartridge focuses on a set of image data representation and access mechanisms sufficient to support many image applications, and the development of more specialized image cartridges.

Figure 1-1 Cartridges and the Network Computing Architecture

The primary focus of Visual Information Retrieval Cartridge is to provide storage, retrieval, reformatting, compression, decompression, and a minimal set of data manipulation services, including scaling and cropping.

It is possible to extend this data cartridge by creating a new object type or a new composite object type based on the provided Visual Information Retrieval types. Extending a data cartridge requires the Objects Option of Oracle8 Enterprise Edition. See the example in Section 3.7 for more information.

1.3 Image Concepts

This section contains conceptual material about digital images. Chapter 2 contains conceptual information about content-based retrieval and using Visual Information Retrieval Cartridge to build image applications or specialized image cartridges.

1.3.1 Digital Images

Visual Information Retrieval Cartridge supports two-dimensional, static, digital images stored as binary representations of real-world objects or scenes. Images may be produced by a document or photograph scanner, a video source such as a camera or video tape recorder connected to a video digitizer or frame grabber, other specialized image capture devices, or even by program algorithms. Capture devices take an analog or continuous signal, such as the light that falls onto the film in a camera, and convert it into digital values on a two-dimensional grid of data points known as pixels.

Visual Information Retrieval Cartridge provides the mechanism to integrate the storage and retrieval of images in Oracle databases using the Oracle8 Enterprise Edition universal data server.

1.3.2 Image Components

A digital image can be thought of as consisting of the image data (digitized bits) and attributes that describe the characteristics of the image. Image applications sometimes associate application-specific information, such as the name of the person whose image a photograph represents, with an image by storing descriptive text in an attribute or column in the database table.

The minimal attributes carried along with an image may include such things as its size (height in scan lines and width in pixels), the resolution at which it was sampled, and the number of bits per pixel in each of the colors that were sampled. The data attributes describe the image as it was produced by the capture device.

The image data (pixels) can have varying depths (bits per pixel) depending upon how the image was captured, and they can be organized in various ways. The organization of the image data, known as the data format, is crucial to access and represent the image.

The size of digital images (number of bytes) tends to be large compared to traditional computer objects such as numbers and text. Therefore, many compression schemes are in use which squeeze an image into fewer bytes, thus putting a smaller load on storage devices and networks. Lossless compression schemes squeeze an image in such a fashion that when it is decompressed, the resulting image is bit-for-bit identical with the original. Lossy compression schemes do not result in a bit-wise identical image when decompressed, but one in which the changes may be imperceptible to the human eye, or at worst, tolerable.

Visual Information Retrieval Cartridge also provides a signature attribute that permits content-based retrieval. The signature is a vector containing detailed information about the visual attributes of the image. The signature is created when the image is processed by Visual Information Retrieval Cartridge, and is used in all content-based queries. For more information about the signature attribute, see Section 2.2.

1.3.3 Interchange Formats

Image interchange format describes a well-defined organization and use of image attributes, data, and often compression scheme, allowing different applications to create, interchange, and use images. Interchange formats are often stored in or as disk files, but may also be exchanged in a sequential fashion over a network and be referred to as a protocol. There are many application subdomains within the digital imaging world and many applications that create or use digital images within these. To assist application developers, Visual Information Retrieval Cartridge supports many popular interchange formats (see Appendix A, "File and Compression Formats".)

1.4 Object Relational Technology

The Oracle8 Enterprise Edition universal data server is an object relational database management system. That means that in addition to its traditional role in the safe and efficient management of relational data, it now provides support for the definition of object types including the data involved in an object and the operations that can be performed on it (methods). This powerful mechanism, well established in the object-oriented world, includes integral support for binary large objects (BLOBs) to provide the basis for adding complex objects, such as digital images, to Oracle databases.

See the following for extensive information on using BLOBs and BFILEs:

1.4.1 Storing Images

Visual Information Retrieval Cartridge can store digital images within the Oracle database under transactional control through the BLOB mechanism. It can also externally reference digital images stored in flat files through the BFILE mechanism. Although this latter mechanism is particularly convenient for integrating pre-existing sets of flat-file images with an Oracle database, these images will not be under transactional control. BLOB stored images have an object relational type known as ORDVirB, while BFILE stored images have an object relational type known as ORDVirF.

1.4.2 Querying Images

Once stored within an Oracle database, an image can be queried and retrieved by finding a row in a table that contains the image using the various alphanumeric columns (attributes) of the table. For example, select a photograph from the Employee table where the employee name is Jane Doe. An example of content-based retrieval might be as follows: using the photograph of Jane Doe for comparison, find all other photographs similar to Jane Doe's in the Employee table or some other table. (Moreover, to refine the meaning of "similar" in this case, you can experiment with different weight values for the visual attributes of global color, local color, texture, and structure.)

The collection of digital images in the database can be related to some set of attributes or keywords that describe the associated content. The image content can be described with text and numbers such as dates and identification numbers. For Oracle8, image attributes can now reside in the same table as the image ODT. Alternatively, the application designer could define a composite ODT that contains one of the cartridge ODTs along with other attributes.

1.4.3 Accessing Images

Applications access and manipulate images using SQL or PL/SQL through the object relational image types ORDVirB and ORDVirF. The object syntax for accessing attributes within a complex object, such as an image, is the dot notation:


The syntax for invoking methods of a complex object, such as an image, is also the dot notation:

variable.function(parameter1, parameter2, ...)

See the Oracle8 Server Concepts manual for information on this and other SQL syntax.

1.5 Cartridge Methods and Operations

Visual Information Retrieval Cartridge provides several functions for performing format conversion, compression, and data manipulation operations on image data. It also provides the ability to extract image properties and to compare images based on their content. This section presents a conceptual overview of the Visual Information Retrieval Cartridge methods and operations.

1.5.1 Image Property Extraction

The SetProperties( ) method is used to extract important properties from image data, including the height and width in pixels, total size in bytes, file format (such as TIFF and BMP), compression format (such as JPEG and LZW), content format (such as monochrome and 8-bit grayscale), and signature.

The size of the image data may be machine dependent. Importing and exporting images may require a recalculation to determine the current properties.

1.5.2 Image Analysis and Comparison

The Analyze( ) operator examines an image and creates a signature based on the global and local colors, texture, and structure of the image content. Two additional operators, Score( ) and Similar( ), compare the signatures of two images to determine if the images match based on a set of user-supplied criteria.

1.5.3 Image Modification

The Process( ) and ProcessCopy( ) methods are used for image format conversion, compression, and basic manipulation functions including scaling and cutting. The image may be compressed using an algorithm from the set of supported image formats and compression schemes. For example, image data in the TIFF format may be compressed using Packbits, Huffman, JPEG, LZW, or one of the other supported schemes. Appendix A, "File and Compression Formats" lists the supported image formats and related compression schemes.

For the initial release of this cartridge, the output of any image manipulation function must be directed to a BLOB. In-place modification is supported for BLOBs, not for BFILEs.

1.5.4 Image Copy

The CopyContent( ) method makes a copy of an image into an empty BLOB selected for update. You can copy from a BLOB or BFILE, but can only write to a BLOB.


Copyright © 1997 Oracle Corporation.

All Rights Reserved.