Color Histogram Normalization using Matlab and Applications in CBIR. László Csink, Szabolcs Sergyán Budapest Tech SSIP 05, Szeged



Similar documents
Component Ordering in Independent Component Analysis Based on Data Power

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

MATH APPLIED MATRIX THEORY

Linear Algebra and TI 89

Data Mining: Algorithms and Applications Matrix Math Review

MATH 423 Linear Algebra II Lecture 38: Generalized eigenvectors. Jordan canonical form (continued).

Similarity and Diagonalization. Similar Matrices

Manifold Learning Examples PCA, LLE and ISOMAP

Principal components analysis

2+2 Just type and press enter and the answer comes up ans = 4

Subspace Analysis and Optimization for AAM Based Face Alignment

Linear Algebra Review. Vectors

Recall the basic property of the transpose (for any A): v A t Aw = v w, v, w R n.

K-Means Clustering Tutorial

Section 5.3. Section 5.3. u m ] l jj. = l jj u j + + l mj u m. v j = [ u 1 u j. l mj

Vision based Vehicle Tracking using a high angle camera

by the matrix A results in a vector which is a reflection of the given

How long is the vector? >> length(x) >> d=size(x) % What are the entries in the matrix d?

Reductions & NP-completeness as part of Foundations of Computer Science undergraduate course

[1] Diagonal factorization

The Image Deblurring Problem

Module II: Multimedia Data Mining

Medical Information Management & Mining. You Chen Jan,15, 2013 You.chen@vanderbilt.edu

Nonlinear Iterative Partial Least Squares Method

Chapter 17. Orthogonal Matrices and Symmetries of Space

TOOLS FOR 3D-OBJECT RETRIEVAL: KARHUNEN-LOEVE TRANSFORM AND SPHERICAL HARMONICS

Review Jeopardy. Blue vs. Orange. Review Jeopardy

Mehtap Ergüven Abstract of Ph.D. Dissertation for the degree of PhD of Engineering in Informatics

How To Cluster

FUZZY CLUSTERING ANALYSIS OF DATA MINING: APPLICATION TO AN ACCIDENT MINING SYSTEM

Lecture 5: Singular Value Decomposition SVD (1)

Compensation Basics - Bagwell. Compensation Basics. C. Bruce Bagwell MD, Ph.D. Verity Software House, Inc.

Introduction to Matrix Algebra

Eigenvalues and Eigenvectors

Introduction to MATLAB (Basics) Reference from: Azernikov Sergei

DATA ANALYSIS II. Matrix Algorithms

A Survey on Outlier Detection Techniques for Credit Card Fraud Detection

Data Storage 3.1. Foundations of Computer Science Cengage Learning

Notes on Orthogonal and Symmetric Matrices MENU, Winter 2013

MAT 242 Test 2 SOLUTIONS, FORM T

CS3220 Lecture Notes: QR factorization and orthogonal transformations

Vectors VECTOR PRODUCT. Graham S McDonald. A Tutorial Module for learning about the vector product of two vectors. Table of contents Begin Tutorial

Soft Clustering with Projections: PCA, ICA, and Laplacian

The Vector or Cross Product

The Characteristic Polynomial

Volume 2, Issue 9, September 2014 International Journal of Advance Research in Computer Science and Management Studies

Introduction to Matrices for Engineers

Cross product and determinants (Sect. 12.4) Two main ways to introduce the cross product

Eigenvalues, Eigenvectors, Matrix Factoring, and Principal Components

EM Clustering Approach for Multi-Dimensional Analysis of Big Data Set

How To Solve The Cluster Algorithm

The Scientific Data Mining Process

Weighted-Least-Square(WLS) State Estimation

Non-negative Matrix Factorization (NMF) in Semi-supervised Learning Reducing Dimension and Maintaining Meaning

v w is orthogonal to both v and w. the three vectors v, w and v w form a right-handed set of vectors.

A tutorial on Principal Components Analysis

Beginner s Matlab Tutorial

LINEAR ALGEBRA. September 23, 2010

Figure 1.1 Vector A and Vector F

Chapter 6. Orthogonality

Chapter 4. Moment - the tendency of a force to rotate an object

Environmental Remote Sensing GEOG 2021

Orthogonal Diagonalization of Symmetric Matrices

Efficient Attendance Management: A Face Recognition Approach

University of Lille I PC first year list of exercises n 7. Review

Dimensionality Reduction: Principal Components Analysis

The PageRank Citation Ranking: Bring Order to the Web

HSI BASED COLOUR IMAGE EQUALIZATION USING ITERATIVE n th ROOT AND n th POWER

SYSTEMATIC STUDY OF COLOR SPACES AND COMPONENTS FOR THE SEGMENTATION OF SKY/CLOUD IMAGES

COLOR-BASED PRINTED CIRCUIT BOARD SOLDER SEGMENTATION

Least-Squares Intersection of Lines

Inner Product Spaces and Orthogonality

Probabilistic Latent Semantic Analysis (plsa)

x1 x 2 x 3 y 1 y 2 y 3 x 1 y 2 x 2 y 1 0.

Linear Codes. Chapter Basics

5: Magnitude 6: Convert to Polar 7: Convert to Rectangular

EXCEL SOLVER TUTORIAL

Green = 0,255,0 (Target Color for E.L. Gray Construction) CIELAB RGB Simulation Result for E.L. Gray Match (43,215,35) Equal Luminance Gray for Green

Analecta Vol. 8, No. 2 ISSN

ADVANCED APPLICATIONS OF ELECTRICAL ENGINEERING

Lecture L3 - Vectors, Matrices and Coordinate Transformations

Linear algebra and the geometry of quadratic equations. Similarity transformations and orthogonal matrices

Francesco Sorrentino Department of Mechanical Engineering

The Projection Matrix

Factor Analysis. Chapter 420. Introduction

Summary: Transformations. Lecture 14 Parameter Estimation Readings T&V Sec Parameter Estimation: Fitting Geometric Models

The Implementation of Face Security for Authentication Implemented on Mobile Phone

Otis Photo Lab Inkjet Printing Demo

x = + x 2 + x

The Singular Value Decomposition in Symmetric (Löwdin) Orthogonalization and Data Compression

Adaptive Face Recognition System from Myanmar NRC Card

Lecture 3: Coordinate Systems and Transformations

Object Recognition and Template Matching

THREE DIMENSIONAL REPRESENTATION OF AMINO ACID CHARAC- TERISTICS

4. Matrix Methods for Analysis of Structure in Data Sets:

State of Stress at Point

VISUAL ALGEBRA FOR COLLEGE STUDENTS. Laurie J. Burton Western Oregon University

Transcription:

Color Histogram Normalization using Matlab and Applications in CBIR László Csink, Szabolcs Sergyán Budapest Tech SSIP 05, Szeged

Outline Introduction Demonstration of the algorithm Mathematical background Computational background: Matlab Presentation of the algorithm Evaluation of the test Conclusion 07. 07. 2005 SSIP'05 Szeged 2

Introduction (1) Retrieval in large image databases Textual key based Key generation is subjective and manual Retrieval is errorless Content Based Image Retrieval (CBIR) Key generation is automatic (possibly time consuming) Noise is unavoidable 07. 07. 2005 SSIP'05 Szeged 3

Introduction (2) If a new key is introduced, the whole database has to be reindexed. In textual key based retrieval the reindexing requires a lot of human work, but in CBIR case it requires only a lot of computing. 07. 07. 2005 SSIP'05 Szeged 4

Introduction (3) CBIR Low level Color, shape, texture High level Image interpretation Image understanding 07. 07. 2005 SSIP'05 Szeged 5

Introduction (4) Typical task of low level CBIR Search for a given object using similarity distance based on content keys One way of defining similarity distance is to use color histograms we concentrate on this approach in the present talk 07. 07. 2005 SSIP'05 Szeged 6

Demonstration of the algorithm 07. 07. 2005 SSIP'05 Szeged 7

Image versions and their histograms 07. 07. 2005 SSIP'05 Szeged 8

Two images and their histograms 07. 07. 2005 SSIP'05 Szeged 9

Similarity distance between two image histograms d Euclid ( hx, hy) = 4 4 4 ( hx ) rgb hy rgb 2 r= 1 g = 1 b= 1 07. 07. 2005 SSIP'05 Szeged 10

Different illuminations 07. 07. 2005 SSIP'05 Szeged 11

Normalized versions 07. 07. 2005 SSIP'05 Szeged 12

Normalization may change image outlook 07. 07. 2005 SSIP'05 Szeged 13

Normalization may change image outlook 07. 07. 2005 SSIP'05 Szeged 14

Mathematical background 07. 07. 2005 SSIP'05 Szeged 15

Color cluster analysis [ ] N f = fij i = 1, K, M ; j = 1, K, 1. Compute the cluster center of all pixels f by m=e[f]. m is a vector which points to the center of gravity. 2. C = E f m f m T [( )( ) ] The eigenvalues (λ 1, λ 2, λ 3 ) and eigenvectors of C are computed directly. 3. Denote the eigenvector belonging to the largest eigenvalue by v=(a,b,c) T. 07. 07. 2005 SSIP'05 Szeged 16

07. 07. 2005 SSIP'05 Szeged 17 Rodrigues formula Rotating v along n (n is a unit vector) by θ: Rv, where ( ) θ cosθ 1 ) ( )sin ( 2 + + = n U n U I R = 0 0 0 ) ( 1 2 1 3 2 3 n n n n n n n U

Color rotation in RGB-space 07. 07. 2005 SSIP'05 Szeged 18

Color rotation in RGB-space cosθ 1 ( a, b, c) T ( 11,, 1 ) T n = 3 1 (,, ) T ( 1,1, 1) T = a b c 3 07. 07. 2005 SSIP'05 Szeged 19

Color rotation in RGB-space 4.Use the Rodrigues formula in order to rotate with θ around n. 5.Shift the image along the main axis of the RGB-cube by (128,128,128) T. 6. Clip the overflows above 255 and the underflows under 0. 07. 07. 2005 SSIP'05 Szeged 20

Computational background Fundamentals of MATLAB 07. 07. 2005 SSIP'05 Szeged 21

Presentation of the algorithm 07. 07. 2005 SSIP'05 Szeged 22

MATLAB code function color_normalization(filename, OUTPUT); inp_image = imread(filename); % read input image [m,n,d]=size(inp_image); f=double(inp_image); M=zeros(m*n,3); z=1; % get size of input image % double needed for computations mv=mean(mean(f)); % a vector containing the mean r,g and b value v1=[mv(1),mv(2),mv(3)]; % means in red, green and blue 07. 07. 2005 SSIP'05 Szeged 23

MATLAB code for i=1:m for j=1:n v=[f(i,j,1),f(i,j,2),f(i,j,3)]; % image pixel at i,j M(z,:) = v - v1; % image normed to mean zero z = z + 1; end end C = cov(m); % covariance computed using Matlab cov function 07. 07. 2005 SSIP'05 Szeged 24

MATLAB code %find eigenvalues and eigenvectors of C. [V,D]=eig(C); % computes the eigenvectors(v) and eigenvalues (diagonal elements of D) of the color cluster C %get the max. eigenvalue meig and the corresponding eigenvector ev0. meig = max(max(d)); % computes the maximum eigenvalue of C. Could also be norm(c) if(meig==d(1,1)), ev0=v(:,1);, end if(meig==d(2,2)), ev0=v(:,2);, end if(meig==d(3,3)), ev0=v(:,3);, end % selects the eigenvector belonging to the greatest eigenvalue 07. 07. 2005 SSIP'05 Szeged 25

MATLAB code Idmat =eye(3); % identity matrix of dimension 3 wbaxis=[1;1;1]/sqrt(3); % unit vector pointing from origin along the main diagonal nvec = cross(ev0,wbaxis); % rotation axis, cross(a,b)=a B cosphi = dot(ev0,wbaxis) % dot product, i.e. sum((ev0.*wbaxis)) sinphi = norm(nvec); % sinphi is the length of the cross product of two unit vectors %normalized rotation axis. nvec = nvec/sinphi; % normalize nvec 07. 07. 2005 SSIP'05 Szeged 26

MATLAB code if(cosphi>0.99) else f=uint8(f); imwrite(f,output); %in this case we dont normalize, output is input etc. % we normalize n3 = nvec(3); n2 = nvec(2); n1 = nvec(1); % remember: this is a unit vector along the rotation axis U = [[ 0 -n3 n2]; [ n3 0 -n1]; [ -n2 n1 0]]; U2 = U*U; Rphi = Idmat + (U*sinphi) + (U2*(1-cosphi)); 07. 07. 2005 SSIP'05 Szeged 27

MATLAB code n0 = [0 0 0]'; n255 = [255 255 255]'; for i=1:m for j=1:n s(1)= f(i,j,1)-mv(1); % compute vector s of normalized image at i,j s(2)= f(i,j,2)-mv(2); s(3)= f(i,j,3)-mv(3); t = Rphi*s' ; % s transposed, as s is row vector, then rotated tt = floor(t + [128 128 128]'); % shift to middle of cube and make it integer 07. 07. 2005 SSIP'05 Szeged 28

MATLAB code tt = max(tt,n0); tt = min(tt,n255); % handling underflow % handling overflow g(i,j,:)=tt; end end g=uint8(g); imwrite(g,output); end % end of normalization 07. 07. 2005 SSIP'05 Szeged 29

Evaluation of the test 07. 07. 2005 SSIP'05 Szeged 30

Test databases 5 objects Alternative color cubes 3 illuminations 3 background 90 images 07. 07. 2005 SSIP'05 Szeged 31

Some test results (without normalization) 07. 07. 2005 SSIP'05 Szeged 32

Some test results (with normalization) 07. 07. 2005 SSIP'05 Szeged 33

Conclusions 07. 07. 2005 SSIP'05 Szeged 34

References Paulus, D., Csink, L., and Niemann, H.: Color Cluster Rotation. In: Proc. of International Conference on Image Processing, 1998, pp. 161-165 Sergyán, Sz.: Special Distances of Image Color Histograms. In: Proc. of 5th Joint Conference on Mathematics and Computer Science, Debrecen, Hungary, June 9-12, 2004, pp. 92 07. 07. 2005 SSIP'05 Szeged 35

Thank you for your attention! Csink.laszlo@nik.bmf.hu Sergyan.szabolcs@nik.bmf.hu 07. 07. 2005 SSIP'05 Szeged 36