1 ALMA MATER STUDIORUM - UNIVERSITÀ DI BOLOGNA Bologna, September 7-10, 2010 Multimedia Databases: Fundamentals, Retrieval Techniques, and Applications A Short Course for Doctoral Students University of Bologna Multimedia Data and Content Representations Ilaria Bartolini - DEIS 2 Multimedia (MM) data and applications MM data coding MM data content representation Outline I. Bartolini – MMDBs Course Media (or medium) I. Bartolini – MMDBs Course 3 A way to distribute and represent information such as books, newspapers, music, radio news, TV news, etc. E.g.: text, graphics, images, voice, sound, music, animation, video, etc. text sound image graphic video animation Media description I. Bartolini – MMDBs Course 4 Perception auditory media (voice, audio, music) visual media (text, graphics, images, moving images) Representation ASCII (text), JPEG (images), MP3 (audio), etc. Presentation input: keyboard, mouse, digital camera, scanner output: paper, monitor, printer, speaker Storage disks (floppy, hard, optical), magnetic tapes, CD-ROM, DVD-ROM Transmission coaxial cable, optical fiber, satellite Information exchange CD, JAZ-Drives, optical fiber
16
Embed
ALMA MATER STUDIORUM - UNIVERSITÀ DI BOLOGNA Outline ...
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
ALMA MATER STUDIORUM - UNIVERSITÀ DI BOLOGNA
Bologna, September 7-10, 2010
Multimedia Databases:
Fundamentals,
Retrieval Techniques, and
Applications
A Short Course for Doctoral Students
University of Bologna
Multimedia Data and
Content Representations
Ilaria Bartolini - DEIS
22
Multimedia (MM) data and applications
MM data coding
MM data content representation
Outline
I. Bartolini – MMDBs Course
Media (or medium)
I. Bartolini – MMDBs Course 3
A way to distribute and represent information such as books,
Although “multimedia” refers to the multiple modalities and/or multiple media types of data, conventionally each medium is studied separately, (from the representation, searching, and indexing points of view)
the features used for media-based retrieval are specific to each media type (e.g., image, audio, and video)
In this course we concentrate on aspects related to
representation of specific media types:
images
audios
videos
search/retrieval of generic MM objects
I. Bartolini – MMDBs Course 12
4
MM data coding
For a personal computer (PC) handling MM data requires a
transformation process that digitize or discretize the original information
to the digital representations known to the PC as data
e.g., an image can be represented as a set of binary numbers for each byte
in the original representation
MM data require a vast amount of data for their representation
3 main reasons for compression
Large storage requirement
Slow devices which do not allow playing back uncompressed MM data
(especially video) in real time
Network bandwidth (not allow real-time video data transmission)
Compression techniques are classified in two basic categories:
Lossless (e.g., Huffman coding)
capable to recover the original representation perfectly
Lossy (e.g., quantization, DCT)
recover the presentation to be similar to the original one
Hybrid (e.g., JPEG, MPEG)
I. Bartolini – MMDBs Course 13
Encyclopedia example
Storage requirements for the
multimedia application encyclopedia:
500,000 pages of text (2 KB per page) -
total 1 GB;
3000 color picture (in average 640x480x24
bits = 1MB/picture) - total 3 GB;
500 maps (in average 640x480x16 bits =
0.6 MB/map) - total 0.3 GB;
60 minutes of stereo sound (176 KB/sec) -
total 0.6 GB;
30 animations, in average 2 minutes in
duration (640x480x16 bits x 16 frames/sec
= 6.5 MB/sec) - total 23.4 GB;
50 digitized movies, in average 1 minute in
duration (640x480x24 bits x 30 frames/sec
= 27.6 MB/sec) – total 82.8 GB.
…for a total of 111.1 GB
storage capacity!!
I. Bartolini – MMDBs Course 14
MM content representation (1)
We can always represent the multimedia data in their original raw
formats (e.g., images in their original formats such as JPEG, TIFF, or
even the raw matrix representation)
considered as awkward representations, and thus are rarely used in a
multimedia application for two basic reasons:
typically take much more space than necessary
more processing time and more storage space
such formats are designed for best archiving the data
e.g., for minimally losing the integrity of the data while at the same
time for best saving the storage space
…but not for fulfilling the MM research purpose, i.e., to represent the MM
data as useful information that would facilitate different processing and
mining operations, having knowledge on the “what the data is”, that is its
semantic knowledge
I. Bartolini – MMDBs Course 15
MM content representation (2)
Example:
3 hierarchical levels of MM content representation:
High-level: semantic knowledge - bridge the semantic gap by integrating high
level concepts (sites, objects, events) and low-level visual/audio features
Mid-level: text annotations/attributes (e.g., “JPEG”, “bear”, “grass”, …)
Low-level: low level visual/audio features (color, texture, shape and structure,
layout; motion; audio - pitch, energy, etc.)
Instead of representing MM data in term of semantic knowledge (ideally
representation), we first represent MM data as features
I. Bartolini – MMDBs Course 16
bear
grass
groundOriginal format: JPEG
Actual content: binary
numbers for each byte
in the original representation
…but this does not tell anything
about what this image is!!!
Ideally semantic representation
5
Categories of features
3 categories of features: statistical, geometric, meta features
Except for some meta features, most of the feature representation
methods are applied to a unit of MM data instead of the whole MM data
e.g., for an image collection a unit is an image, for an audio stream, a unit is
an audio frame, and for a video is a video frame
Statistical features: focus on statistical description of the original MM
data in term of specific aspects, such as the frequency counts for each of
the values of a specific quantity of data
e.g., histograms, transformation coefficients
Geometric features: applied to segmented objects within a MM data unit
e.g., moments, Fourier descriptors
Meta features: include the typical meta data to describe a MM data unit
e.g., scale of the unit, number of objects in the data unit
I. Bartolini – MMDBs Course 17
One image is worth 1,000 words…
Undoubtedly, images are the most wide-spread MM data type, second
only to text data
Their representation is far more complex than the text one and needs
more storage resources
In the following we provide details on
physical image representations
image formats (e.g., BMP, GIF, JPEG, TIFF, …)
some basic features, such as color, texture, and shape and structure
considering general purpose images, i.e., no assumptions on the working domain
global features (related to the whole image)
local features (related to specific objects within the image)
I. Bartolini – MMDBs Course 18
Image representation (1)
Physically speaking a digital image represents a 2-D array of samples,
where each sample is called pixel
The word pixel is derived from the two words “picture” and “element” and
refers to the smallest element in an image
Color depth is the number of bits used to represent the color of a single
pixel in a bitmapped image or video frame buffer (also known as bits per
pixel – bpp)
Higher color depth gives a broader range of distinct colors
I. Bartolini – MMDBs Course 19
Image representation (2)
According to the color depth, images can be classified into:
Binary images: 1 bpp (2 colors), e.g, black white photographic
Computer graphics: 4 bpp (16 colors), e.g., icon
Grayscale images: 8 bpp (256 colors)
Color images: 16 bpp, 24 bpp or more, e.g., color photography
The table shows the color depths used in PCs today:
Dimension is the number of pixels in an image; identified by the width and height
of the image as well as the total number of pixels in the image (e.g., an image
2048 wide and 1536 high (2048 x 1536) contains 3,145,728 pixels - 3.1 Mp)
Spatial resolution is the number of pixels per inch – bpi; the higher the bpi, the
better the resolution (clarity) of the image. Resolution changes according to the
size at which the image is being reproduced
Size [Byte] = (width * high) * color depth/8
I. Bartolini – MMDBs Course 20
Color depth # displayed colors Bytes of storage per pixel Common name
4-bit 16 0.5 Standard VGA
8-bit 256 1.0 256-Color Mode
16-bit 65.536 2.0 True Color
24-bit 16.777.216 3.0 High Color
6
Color depth
I. Bartolini – MMDBs Course 21
Spatial resolution
I. Bartolini – MMDBs Course 22
Example: these images of Former President Clinton demonstrate the effects of
different spatial resolutions. Each higher level of resolution allows you to
distinguish more detail
Color
According to the tri-chromatic theory, the sensation of color is due to the
stimulation of 3 different types of receptors (cones) in the eyes
Consequently, each color can be obtained as the combination of 3
component values (one per receptor type)
A color space defines 3 color channels and how values from such
channels have to be combined in order to obtain a given color
There is a large variety of color spaces (e.g, RGB, CMY, HSV, HSI, HLS,
Lab), each designed for specific purposes, such as displaying (RGB),
printing (CMY), compression (YIQ), recognition (HSV), etc.
It is important to understand that a certain “distance” value in a color
space does not directly correspond to an equal difference in colors’
perception
E.g., distance in the RGB space badly matches human’s perception
I. Bartolini – MMDBs Course 23
Color spaces: RGB
The RGB space is a 3-D cube with coordinates Red,Green, and Blue
The line of equation R=G=B corresponds to gray levels
It can represent only a small range of
potentially perceivable colors
I. Bartolini – MMDBs Course 24
7
MMDB
Color spaces: HSV
The HSV space is a 3-D cone with coordinates Hue,Saturation, and Value:
Hue is the “color”, as described by a wavelength
Hue is the angle around the circle or the regular hexagon; 0 ≤ H ≤ 360
Saturation is the amount of color that is present (e.g., red vs. pink)
Saturation is the distance from the center; 0 ≤ S ≤ 1
The axis S = 0 corresponds to gray levels
Value is the amount of light (intensity, brightness)
Value is the position along the axis of the cone; 0 ≤ V ≤ 1
I. Bartolini – MMDBs Course 25
Saturation of colors
Original image Saturation decreased by 20% Saturation increased by 40%
I. Bartolini – MMDBs Course 26
What the 3 channels represent
The figure contrasts the information carried out by each channel of the RGB
and HSI color spaces
HSI: similar to HSV, the color space is a “bi-cone”
I. Bartolini – MMDBs Course 27
BMP format
Bitmap format encodes images without compression:
size = (number of pixels * bpp)
Example:
a BMP image 640x480 (= 307200 pixels) with color depth 24 bpp
has a size of = 307200 * 24 / 8 = 921600 bytes = ~0.9 MB
The most important compressed formats are:
1. GIF (Graphics Interchange Format)
2. PNG (Portable Network Graphics)
3. JPG (Joint Photographer Expert Group)
4. TIFF (Tagged Image File Format)
I. Bartolini – MMDBs Course 28
8
GIF format
GIF (Graphics Interchange Format)
Introduced by CompuServe in 1987 is one of the most used and
supported format
8 bpp image format, i.e., the color palette is limited to a maximum of 256
colors from the 24-bit RGB color space
GIF images are compressed using the Lempel-Ziv-Welch (LZW) lossless
data compression technique to reduce the file size without degrading the
visual quality
It also supports animations and allows a separate palette of 256 colors for
each frame
The color limitation makes the GIF format unsuitable for reproducing color
photographs and other images with continuous color, but it is well-suited
for simpler images such as graphics or logos with solid areas of color
I. Bartolini – MMDBs Course 29
PNG format
PNG (Portable Network Graphics) was created to improve upon and
replace GIF
It is pronounced “ping”, or “pee-en-jee”. The PNG acronym is optionally
recursive, unofficially standing for PNG's Not GIF!! ;-)
PNG supports palette-based (palettes of RGB 24-bit or RGB 32-bit colors),
and grey-scale images
PNG was designed for transferring images on the Internet, not for print
graphics
Better compression than GIF
PNG does not support animation like GIF does
I. Bartolini – MMDBs Course 30
JPEG format
JPEG (Joint Photographic Experts Group), standard issued in 1992 with the aim
of improving and replacing previous image formats
JPEG images are full-color images (24-bit, or “true color”), unlike GIFs that are
limited to a maximum of 256 colors in an image
there is a lot of interest in JPEG images among photographers, artists, graphic
designers, … and where color fidelity cannot be compromised
JPEG can achieve incredible compression ratios, squeezing graphics down to as
much as 100 times smaller than the original file. This is possible because the
JPEG algorithm discards “unnecessary” data as it compresses the image
There is also an interlaced “Progressive JPEG” format, in which data is
compressed in multiple passes of progressively higher detail
This is ideal for large images that will be displayed while downloading over a slow
connection, allowing a reasonable preview after receiving only a portion of the data
I. Bartolini – MMDBs Course 31
JPEG compression
The standard specifies the codec,
which defines how an image is
compressed into a stream of bytes
and decompressed back into an
image
The compression method is usually
lossy, meaning that some original
image information is lost and cannot
be restored (possibly affecting image
quality). There is an optional
lossless mode defined in the JPEG
standard; however, that mode is not
widely supported in products
Discrete Cosine Transform (DCT) -
lossless
Quantization – lossy
Entropy coding – lossless
I. Bartolini – MMDBs Course 32pixel domain frequency domain
9
Levels of JPEG compression
I. Bartolini – MMDBs Course 33
The figure shows an original photograph (a), and three detail views at different
levels of JPEG compression:
"excellent" quality (b),
"good" quality (c), and
"poor" quality (d) (notice the boxy
quality of this image)
Compression ratio
The basic measure for the
performance of a compression
algorithm is the compression ratio
(CR):
CR = (Orig. size/Compressed size)
Higher compression ration will
produce lower picture quality and
vice versa
I. Bartolini – MMDBs Course 34
1
JPEG 2000 format
JPEG 2000 is an image compression standard and coding system
It was created by the Joint Photographic Experts Group committee in
2000 with the intention of superseding their original DCT-based JPEG
standard (created in 1992) with a newly designed wavelet-based method
Higher compression rate (and implicit information loss) without the “boxy”
effect induced by JPEG
I. Bartolini – MMDBs Course 35
TIFF format
TIFF (Tagged Image File Format) is a file format for storing images,
popular among Apple Macintosh owners, graphic artists, the publishing
industry
As of 2009, it is under the control of Adobe Systems
TIFF is a flexible and adaptable file format:
Can handle multiple images and data in a single file through the inclusion of
“tags” in the file header
Tags represent the basic geometry of the image (e.g., the size), or define how the
image data is arranged and whether various image compression options are used
TIFF format is widely supported by image-manipulation applications, by
publishing and page layout applications, by scanning, faxing, word
processing, optical character recognition and other applications
I. Bartolini – MMDBs Course 36
10
EXIF format
EXIF (Exchangeable Image file Format ) is a specification for the image
file format used by digital cameras
The specification uses the existing JPEG, TIFF, and WAV file formats,
with the addition of specific metadata tags
It is not supported in JPEG 2000,
PNG, or GIF
Used to store photos parameters:
I. Bartolini – MMDBs Course 37
Texture
Unlike color, texture is not a property of the single pixel, rather it is a
collective property of a pixel and its, suitably defined, “neighborhood”
Intuitively, texture provides information about the uniformity, granularity
and regularity of the image surface
It is usually computed just considering the gray-scale values of pixels
(i.e., the V channel in HSV)
“mosaic” effect “blinds” effect
I. Bartolini – MMDBs Course 38
What texture measures
A common model to define texture is based on the properties of
coarseness, contrast e directionality:
Coarseness - coarse vs. fine: it provides information about the “granularity” of
the pattern
Contrast - high vs. low contrast: it measures the amount of local changes in
brightness
Directionality - directional vs. non-directional: it’s a global property of the
image
I. Bartolini – MMDBs Course 39
Shape
Strictly speaking, an image has no relevant shape at all
When we talk about shape, we refer to that of the “object(s)” represented
by the image
Object recognition is a hard task, hardly solvable by any algorithm that
operates in a general scenario (i.e., no knowledge about what to look for)
In practice, shape information is often obtained by “segmenting” the
image into a set of “regions”, and then recovering the contours of such
regions
…and segmentation is typically performed by analyzing color and texture
information…
I. Bartolini – MMDBs Course 40
11
An example of segmentation
A classical problem with segmentation is the trade-off between
homogeneity of a region and number/significance of regions:
How many regions?
How “homogeneous” pixels within a same region should be?
No general answer!
In the limit cases: a single region(!?), each pixel is a region(!?)
I. Bartolini – MMDBs Course 41
Spatial relations
Given image objects, we can
identify local properties:
position;
area;
perimeter;
…
and/or global properties, such as
spatial relations (trough spatial
constraints definition)
To the left, to the right
Object A is to the left of B
Above of, below of
Object A is above object B
I. Bartolini – MMDBs Course 42
A
B
Audio
Audio data are often viewed as 1-D continuous or discrete signals
Many of the models that are applicable to 2-D images has their counterpart in
audio data
With respect to images, audio maintains temporal information
In the following we detail on
physical audio representations
audio formats (e.g., WAV, MP3, MIDI, …)
some domain specific audio features, such as pitch, loudness, beat, rhythm,
etc.
I. Bartolini – MMDBs Course 43
Audio technology (1)
Sound is an oscillation of pressure transmitted through a solid, liquid, or
gas, composed of frequencies within the range of hearing and of a level
sufficiently strong to be heard, or the sensation stimulated in organs of