1 / 82

Banco de Dados Multimídia

Banco de Dados Multimídia. Capítulo 4: BD Imagens UFCG/CEEI/COPIN Cláudio Baptista. BD Imagens. Motivação Grande volume de imagens disponíveis Projeto NASA EOSDIS envia Petabytes de imagens por ano! Cada cidadão norte-americanoque tiver tirado um passaporte tem sua fotografia digital

gage-myers
Télécharger la présentation

Banco de Dados Multimídia

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Banco de Dados Multimídia Capítulo 4: BD Imagens UFCG/CEEI/COPIN Cláudio Baptista

  2. BD Imagens • Motivação • Grande volume de imagens disponíveis • Projeto NASA EOSDIS envia Petabytes de imagens por ano! • Cada cidadão norte-americanoque tiver tirado um passaporte tem sua fotografia digital • Hospitais estão armazenando imagens: raios-X, Tomografia, Ressonância Magnética • Museus e bibliotecas digitais multimídia têm usado imagens digitais • Usuários têm gerado fotografias digitais

  3. BD Imagens • Em SGBD convencionais (ex. relacional), estas imagens são consultadas pelas anotações que são realizadas (metadados) • Existe a necessidade de se realizar consulta nas próprias imagens, usando metadados de baixo nível: cor, textura, forma. • Este é o propósito da técnica de Content-Based Retrieval - CBR

  4. BD Imagens • O conteúdo de uma imagem consiste de todos os objetos visíveis a uma aplicação • Este objetos têm as seguintes propriedades: • descritor de forma: forma/localização de objeto na imagem, em geral usam-se retângulos (bounding) que identificam (circundam) as formas. • descritor de propriedades: propriedades de pixels (ou grupo de pixels), ex. valores RGB ou tons-de-cinza.

  5. BD Imagens NY, NY Cadê a torre? Na figura acima os retângulos mostram a extração de formas do objeto avião. Nem sempre retângulos são suficientes, porquê?

  6. BD Imagens • Em geral, ao invés de trabalhar com cada pixel individualmente, agrupam-se estes em células. • Definição: Cada imagem I tem um par de inteiros positivos (m,n), chamado de grid de resolução da imagem. Isto divide a imagem em (m x n) células de tamanho igual. • Cada célula num dado grid consiste de uma coleção de pixels.

  7. BD Imagens • Definição: Uma propriedade de uma célula é uma tripla (nome, valor, método), onde • nome: denota o nome da propriedade • valor: é um conjunto de valores que a propriedade pode assumir • método: é o algoritmo que computa a propriedade • Ex.: Imagem preto-e-branco e outra tons de cinza (graylevel), uma propriedade de uma célula seria • (bwcolor, {b,w}, bwalgo) • (graylevel, [0,1], grayalgo)

  8. BD Imagens • Onde graylevel: • graylevel(célula) = XLBiXUBYLBjYUB findgray(i,j)/ (XUB - XLB) x (YUB - YLB) • Onde • XLB: (X Lower Bound) limite inferior X do retângulo que contorna a célula • XUB: (X Upper Bound) limite superior X do retângulo que contorna a célula

  9. BD Imagens • Definição: Uma forma de um objeto é qualquer conjunto de pontos P tais que se p,q  P, então existe uma sequência de pontos p1, …, pn em P tais que: • p = p1 e q = pn •  1in, p i+1 é um vizinho de pi , isto é, se pi = (xi,yi) e p i+1 = (xi+1,yi+1), então (xi+1,yi+1) satisfaz uma das seguintes condições: (xi+1,yi+1) = ( xi + 1, yi); (xi+1,yi+1) = ( xi - 1, yi); (xi+1,yi+1) = ( xi, yi + 1); (xi+1,yi+1) = ( xi, yi - 1); (xi+1,yi+1) = ( xi + 1, yi+1); (xi+1,yi+1) = ( xi + 1, yi-1); (xi+1,yi+1) = ( xi - 1, yi+ 1); (xi+1,yi+1) = ( xi - 1, yi - 1)

  10. BD Imagens • Definição: um retângulo é uma forma de objeto P, tal que existe inteiros XLB,XUB, YLB, YUB tais que: • P = {(x,y)| XLBxXUB & YLByYUB}

  11. BD Imagens • Imagens são representadas por bitmaps (raster images) • Um bitmap é uma matriz bidimensional formada por elementos chamados pixels • Cada pixel tem um valor numérico chamado aplitude • O número de bits utilizado para um pixel é chamado de pixel depth

  12. BD Imagens • Um pixel depth pode representar: • Um ponto preto ou branco • Um nível de cinza (imagem monocromática) • Atributos de cor (imagem colorida)

  13. BD Imagens • Compressão de Imagens: em geral representar imagens com todos os seus pixels pode ser inviável dado que podemos ter grandes valores, (1024X1024). Portanto, usamos técnicas de compressão que transforma a imagem original numa versão comprimida (menor)

  14. BD Imagens - Compressão • A criação de uma imagem comprimida consiste em duas partes: • Seleção do tamanho • Seleção do algoritmo de transformação (com perda e sem perda) • Transformada Discreta de Fourier (DFT) p1-1 p2-1 • DFT(x,y) = 1/p1p2 *   (I(a,b) x e-j(2xa/p1 + 2yb/p2)a=0 b=0 • onde j é o complexo (-1)1/2 • DFT é sem perda e preserva distância Euclidiana

  15. BD Imagens - Compressão • A Transformada Discreta do Cosseno (DCT) • DCT(i,j) = 2/(p1p2)1/2(i) * (j)r=0, p1-1 s=0, p2-1 ( cos ( ((2r + 1) x i)/2r) * cos (((2s + 1) x j)/2s)) • onde (i),(j) = 1/(2) 1/2 quando i, j = 0, ou 1 caso contrário • DCT é computado rapidamente • DCT é sem perda

  16. Formatos de Imagens • Não-comprimidas • Pgm (portable gray map) ou ppm (portable pixel map – Unix • BMP (gray e color) - Windows

  17. Formatos de Imagens • Comprimidas • GIF(Graphics Interchange Format): • Usa algorítimo de compressão LZW (Lempel-Ziv-Welch) • Taxa de compresão média : 4:1 • Pode ter animação

  18. Formatos de Imagens • Comprimidas • JPEG (Joint Photographics Expert Group) • Bom para fotos, não muito bom para pequenas imagens menores do que 100x100 pixels • Taxa de compressão 10:1 a 100:1

  19. Formatos de Imagens • Comprimidas • PNG (Portable Network Graphics) • Mais color depth (48bits) do que GIF(8bits) • 10 a 30% menores do que LZW (Gif) • Metadados textuais podem ser adicionados

  20. Ex. Imagens comprimidas jpg (6KB) Bmp (57KB) png (15KB) gif (16KB)

  21. Segmentação de Imagens

  22. Busca em Imagens • BD Tradicionais: • Designed to manage one-dimensional datasets • consisting of simple data types, such as strings and • numbers • Limited kinds of queries: exact match, • partial match, and range queries • Well-understood indexing methods: B-trees, • hashing

  23. MM queries - Características • We normally retrieve a few records from a traditional DBMS through the specification of exact queries based on the notions of “equality”. • The types of queries expected in an image/video DBMS are relatively vague or fuzzy, and are based on the notion of “similarity”.

  24. MM queries - Características The indexing structure should be able to satisfy similarity-based queries for a wide range of similarity measures.

  25. CBR • It is necessary to extract the features which are characteristics of the image and index the image on these features. Examples: Shape descriptions, texture properties.

  26. CBR • Typically there are a few different quantitative measures which describes the various aspect of each feature. Example: The texture attribute of an image can be modeled as a 3-dimensional vector with measures of directionality, contrast, and coarseness.

  27. Busca em Imagens • BD Tradicionais: • Designed to manage one-dimensional datasets • consisting of simple data types, such as strings and • numbers • Limited kinds of queries: exact match, • partial match, and range queries • Well-understood indexing methods: B-trees, • hashing

  28. MM queries - Características • We normally retrieve a few records from a traditional DBMS through the specification of exact queries based on the notions of “equality”. • The types of queries expected in an image/video DBMS are relatively vague or fuzzy, and are based on the notion of “similarity”.

  29. MM queries - Características The indexing structure should be able to satisfy similarity-based queries for a wide range of similarity measures.

  30. CBR • It is necessary to extract the featureswhich are characteristics of the image and index the image on these features. Examples: Shape descriptions, texture properties.

  31. CBR • Typically there are a few different quantitative measures which describes the various aspect of each feature. Example: The texture attribute of an image can be modeled as a 3-dimensional vector with measures of directionality, contrast, and coarseness.

  32. CBR • Multimedia require support of multi-dimensional datasets • E.g., a 256 dimensional feature vector. • That implies • Specialized kinds of queries • New indexing approaches. Two choices: • Map n-dimensional data to a single dimension and use traditional indexing structures (B-trees) • Develop specialized indexing structures

  33. Low-Dimensional Indexing Applications • Spatial Databases (GIS, CAD/CAM) • Number of dimensions: 2-4 • Spatial queries. For example: • Which objects intersect a given 2D or 3D rectangle • Which objects intersect a given object • Specialized indexing structures • quad-tree, BSP-tree, K-D-B-tree, R-tree, R+-tree, R*-tree, X-tree, …

  34. High-Dimensional (HD) Indexing Applications • Multimedia databases (Images, Sounds, Movies) • Map multimedia object to a n-dimensional point called feature vector • Number of dimensions: typically 256 - 1000 • Indexing: • Actually index only feature vectors • Data structures used: • same as for spatial databases (R-Trees, X-trees) • or, structures tailored to index specifically feature vectors(TV-Tree)

  35. HD Considerations (1) • Main problem: • In general there is no total-ordering of d-dimensional objects that preserves spatial proximity • Data comes in two forms • N-dimensional points • N-dimensional objects extended in space • Objects can have rather complex shapes (extents) • Typically abstract from the actual form and index some simpler shapes, such as Minimum Bounding Boxes (MBB) or n-dimensional hyper spheres

  36. HD Considerations (2) • “Dimensionality curse” • As the number of dimensions increases • performance tends to degrade (often exponentially) • Indexing structures become inefficient for certain kinds of queries • Performance is often CPU-bound, not just I/O-bound as in traditional DBMS

  37. HD Queries Overview • No standard algebra or query language • The set of operators strongly depends on application domain • Queries are usually expressed by an extension of SQL (e.g. abstract data types) • Although there are no standards, some queries are common

  38. Multiattribute and Spatial Indexing of Multimedia Objects • Spatial Databases: Queries involve regions that are represented as multidimensional objects. Example: A rectangle in a 2-dimensional space involves four values: two points and two values for each point. Access methods that index on multidimensional keys yield better performance for spatial queries.

  39. Multiattribute and Spatial Indexing of Multimedia Objects • Multimedia Databases: Multimedia objects typically have several attributes that characterize them. Example: Attributes of an image include coarseness, shape, color, etc. • Multimedia databases are also good candidates for multikey search structures.

  40. Similarity Based on Weighted Euclidean Distance A suitable measure of similarity between an image feature vector F and query vector Q is the weighted metric W: where A is an nxn matrix which can be used to specify suitable weighting measures.

  41. Query Types Querying in image DBMS is envisioned to be iterative in nature: • Vague Queries: Queries at the earlier stage can be very “loose”. Retrieve images containing textures similar to this sample. • K-nearest-neighbor-queries: The user specifies the number of close matches to the given query point. Retrieve 10 images containing textures directionally similar to this sample • Range queries: An interval is given for each dimension of the feature space and all the records which fall inside this hypercube are retrieved.

  42. Query Types . . . . . . . + . . . + r + .Q . . . Q Q r is large r is small range query => vague query => 3-nearest neighbor query

  43. Indexing Multimedia Objects • Can’t we index multiple features using a B+-tree ? • B+-tree defines a linear order • Similar objects (e.g., O1 and O2) can be far apart in the indexing order • Why multidimensional indexing ? • A multidimensional index defines a “spatial order” • Conceptually similar objects are spatially near each other in the indexing order (e.g., O1 and O2)

  44. Some Multidimensional Search Structures • Space Filling Curves • k-d Trees • Multidimensional Tries • Grid File • Point-Quad Trees • R Trees, R*, TV, SS • D-Trees • VA files

  45. CBIR - Content-Based Image Indexing • Keyword Approach • Problem: there is no commonly agreed-upon vocabulary for describing image properties. • Computer Vision Techniques • Problem: General image understanding and object recognition is beyond the capability of current computer vision technology.

  46. CBIR - Content-Based Image Indexing • Image Analysis Techniques • It is relatively easy to capture the primitive image properties such as • prominent regions, • their colors and shapes, • and related layout and location information within images. • These features can be used to index image data.

  47. CBIR – Features mais usadas • Edge • Region • Color • Shape • Location • Size • Texture

  48. CBIR – Edge detection horizontal edges vertical edges lena.gif norm of the gradient after thresholding after thinning

  49. CIBR - Region

  50. CBIR - Cor • We can divide the color space into a small number of zones, each of which is clearly distinct with others for human eyes. • Each of the zones is assigned a sequence number beginning from zero.

More Related