SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
© 2011 Frank Nielsen
INF555
Fundamentals of 3D
Lecture 1 Follow-up: Connected Components
Lecture 2: Convolutions and Filters
Matrix decompositions
Frank Nielsen
21 Septembre 2011
© 2011 Frank Nielsen
Labelling connected components (Union-Find)
Input: binary image Foreground/Background pixels
Output: Each connected component
Extracting one component
© 2011 Frank Nielsen
Useful in computer vision...
→ Image segmentation
How many (large) objects?
© 2011 Frank Nielsen
A simple algorithm
Initially each pixel defines its own region
(labelled by say the pixel index: x+y*width)
Scan the image from left to right and top to bottom:
If current pixel is background AND East pixel is background:
Merge their regions into one = « connect » them
If current pixel is background AND South pixel is background:
Merge their regions into one = « connect » them
Extract regions (floodfilling or single pass algorithm)
Initially each pixel defines its own region
(labelled by say the pixel index: x+y*width)
Scan the image from left to right and top to bottom:
If current pixel is background AND East pixel is background:
Merge their regions into one = « connect » them
If current pixel is background AND South pixel is background:
Merge their regions into one = « connect » them
Extract regions (floodfilling or single pass algorithm)
How do we merge quickly disjoint sets?
© 2011 Frank Nielsen
Union-Find abstract data-structures
c
RANK=DEPTH
Visual
Depiction
© 2011 Frank Nielsen
class UnionFind{
int [ ] rank; int [ ] parent;
UnionFind(int n)
{int k;
parent=new int[n];
rank=new int[n];
for (k = 0; k < n; k++)
{parent[k] = k; rank[k] = 0; }
}
int Find(int k)
{while (parent[k]!=k ) k=parent[k]; return k;}
int Union(int x, int y)
{
x=Find(x);y=Find(y);
if ( x == y ) return -1; // Do not perform union of same set
if (rank[x] > rank[y])
{parent[y]=x;
return x;}
else
{ parent[x]=y;
if (rank[x]==rank[y]) rank[y]++;return y;}
}
}
c
// Attach tree(y) to tree(x)
// else
// Attach tree(x) to tree(y)
and if same depth, then increase depth of y by one
// Attach tree(y) to tree(x)
// else
// Attach tree(x) to tree(y)
and if same depth, then increase depth of y by one
© 2011 Frank Nielsen
● Variable name aliases.
• Pixels in a digital photo.
• Computers in a network.
• Web pages on the Internet.
• Transistors in a computer chip.
Many applications of the union-find data-structure
© 2011 Frank Nielsen
Yet another example of UF/segmentation:
Inbetweening for cell animation
http://www.vuse.vanderbilt.edu/~bobbyb/pubs/sca06.html
© 2011 Frank Nielsen
Minimum Spanning Tree (Kruskal's algorithm)
http://en.wikipedia.org/wiki/Minimum_spanning_tree
http://en.wikipedia.org/wiki/Kruskal's_algorithm
Implemented using Union-Find data structure
© 2011 Frank Nielsen
Intensity=0.3red+0.59green+0.11blue
Convolutions et filtres
Color image Grey image
© 2011 Frank Nielsen
Image Convolution
Roberts Cross (edge) detection
Discrete gradient (maximal response for edge at 45 degrees)
The two filters are 90 degrees apart
(inner product is zero)
Approximated by
© 2011 Frank Nielsen
Roberts Cross edge detector
Approximated by
Input Filter response (x5) Thresholded
© 2011 Frank Nielsen
Sobel edge detector
Approximated by
© 2011 Frank Nielsen
Sobel Roberts Crossl
http://homepages.inf.ed.ac.uk/rbf/HIPR2/sobeldemo.htm
© 2011 Frank Nielsen
Gaussian smoothing
Normalize discrete Gaussian kernel to 1
Two parameters to tune:
● K, the dimension of the matric
● Sigma, the smoothing width...
© 2011 Frank Nielsen
Blurring, low-pass filter eliminates edges...
Source Sigma=1, 5x5 Sigma=2, 9x9 Sigma=4, 15x15
© 2011 Frank Nielsen
Mean filter= Uniform average
Source Corrupted, Gaussian noise (sigma=8) Mean filter 3x3
© 2011 Frank Nielsen
Corrupted, Gaussian noise (sigma=13)
Mean filter= Uniform average
Source Mean filter 3x3
© 2011 Frank Nielsen
Median filter
Source Median filter 3x3Corrupted, Gaussian noise (sigma=8)
© 2011 Frank Nielsen
Sharpening: Identity+Laplacian kernel
Source image
© 2011 Frank Nielsen
Bilateral filtering
Traditional spatial gaussian filtering
© 2011 Frank Nielsen
Bilateral filtering
New! gaussian on the intensity difference filtering
Bilateral Filtering for Gray and Color Images, Tomasi and Manduchi 1998
.... SUSAN feature extractor...
© 2011 Frank Nielsen
*
*
*
input output
Same Gaussian kernel everywhere.
Bilateral filtering
Traditional spatial gaussian filtering
© 2011 Frank Nielsen
*
*
*
input output
The kernel shape depends on the image content.
space weight
not new
range weight
I
new
normalization
factor
new
( ) ( )∑∈
−−=
S
IIIGG
W
IBF
q
qqp
p
p qp ||||||
1
][ rs σσ
© 2011 Frank Nielsen
Bilateral filtering
l Example of Bilateral filtering
l Low contrast texture has been removed
● Brute-force implementation is slow > 10min
(but real-time with GPU and better algorithms)
© 2011 Frank Nielsen
Originimage Bilateral(3)
Bilateral filtering
© 2011 Frank Nielsen
Results
OriginImage
Oneiteration
fiveiterations
Bootstrapping
http://people.csail.mit.edu/sparis/siggraph07_course/
© 2011 Frank Nielsen
Bilateral mesh
denoising
Bilateral filtering extends to meshes
Source
© 2011 Frank Nielsen
Harris-Stephens edge detector: Feature points
Aim at finding good feature
© 2011 Frank Nielsen
Harris-Stephens edge detector
Measure the corner response as
Algorithm:
– Find points with large corner response function R
(R > threshold)
– Take the points of local maxima of R
© 2011 Frank Nielsen
Harris-Stephens edge detector
Corner response R
© 2011 Frank Nielsen
Thresholding R>cste
Local maxima of R
© 2011 Frank Nielsen
Superposing local maxima
on source images
© 2011 Frank Nielsen
Invariant to orientation but
Depends on the scaling of the image
© 2011 Frank Nielsen
http://www.ptgui.com/download.html
Application to feature matching for image panorama tools
© 2011 Frank Nielsen
Matrix operations
using JAMA
© 2011 Frank Nielsen
Use JAMA library
http://math.nist.gov/javanumerics/jama/
JAMA : A Java Matrix Package
javac -classpath Jama-1.0.2.jar filename.java
Using JCreator
© 2011 Frank Nielsen
http://www.bluebit.gr/matrix-calculator/
Write a class wrapper around Jama
Essential operations are:
© 2011 Frank Nielsen
LU Decomposition of rectangular matrices
Product of a lower and upper triangular matrices
© 2011 Frank Nielsen
P permutation matrix
LU Decomposition for solving linear systems:
LU Decomposition of rectangular matrices
Trivial to solve since L is lower triangular matrix
© 2011 Frank Nielsen
Matrix A=Matrix.random(3,3);
Matrix b = Matrix.random(3,1);
Matrix x= A.solve(b);
System.out.println("A="); A.print(6,3);
System.out.println("b="); b.print(6,3);
System.out.println("x="); x.print(6,3);
LUDecomposition luDecomp=A.lu();
Matrix L=luDecomp.getL();
Matrix U=luDecomp.getU();
int [ ] pivot= luDecomp.getPivot();
System.out.println("L="); L.print(6,3);
System.out.println("U="); U.print(6,3);
for(int i=0;i<pivot.length;i++)
System.out.print(pivot[i]+" ");
System.out.println("");
A=
0.345 0.090 0.599
0.932 0.428 0.703
0.420 0.089 0.439
b=
0.342
0.192
0.806
x=
4.432
-7.913
-0.791
L=
1.000 0.000 0.000
0.450 1.000 0.000
0.370 0.660 1.000
U=
0.932 0.428 0.703
0.000 -0.103 0.122
0.000 0.000 0.258
1 2 0
A=
0.345 0.090 0.599
0.932 0.428 0.703
0.420 0.089 0.439
b=
0.342
0.192
0.806
x=
4.432
-7.913
-0.791
L=
1.000 0.000 0.000
0.450 1.000 0.000
0.370 0.660 1.000
U=
0.932 0.428 0.703
0.000 -0.103 0.122
0.000 0.000 0.258
1 2 0
© 2011 Frank Nielsen
QR Decomposition
Q: Orthogonal matrix
R: Upper triangular matrix
A=
0.821 0.098 0.374
0.057 0.151 0.036
0.994 0.150 0.703
Q=
-0.637 0.131 0.760
-0.044 -0.990 0.134
-0.770 -0.052 -0.636
R=
-1.290 -0.185 -0.781
0.000 -0.145 -0.023
0.000 0.000 -0.158
A=
0.821 0.098 0.374
0.057 0.151 0.036
0.994 0.150 0.703
Q=
-0.637 0.131 0.760
-0.044 -0.990 0.134
-0.770 -0.052 -0.636
R=
-1.290 -0.185 -0.781
0.000 -0.145 -0.023
0.000 0.000 -0.158
import Jama.*;
class QRDecompositionTest
{
public static void main(String args[])
{
Matrix A=Matrix.random(3,3);
QRDecomposition qr=new QRDecomposition(A);
System.out.println("A=");A.print(6,3);
Matrix Q=qr.getQ();
System.out.println("Q=");Q.print(6,3);
Matrix R=qr.getR();
System.out.println("R=");R.print(6,3);
}
}
import Jama.*;
class QRDecompositionTest
{
public static void main(String args[])
{
Matrix A=Matrix.random(3,3);
QRDecomposition qr=new QRDecomposition(A);
System.out.println("A=");A.print(6,3);
Matrix Q=qr.getQ();
System.out.println("Q=");Q.print(6,3);
Matrix R=qr.getR();
System.out.println("R=");R.print(6,3);
}
}
Useful for solving least squares problem
© 2011 Frank Nielsen
Cholesky decomposition
For a symmetric positive definite matrix A,
Cholesky decomposition yields:
L is a lower triangular matrix
L* is the conjugate transpose
© 2011 Frank Nielsen
A=
0.688 0.342 0.046
0.342 0.411 0.345
0.046 0.345 0.962
L=
0.829 0.000 0.000
0.412 0.491 0.000
0.055 0.658 0.725
0.688 0.342 0.046
0.342 0.411 0.345
0.046 0.345 0.962
A=
0.688 0.342 0.046
0.342 0.411 0.345
0.046 0.345 0.962
L=
0.829 0.000 0.000
0.412 0.491 0.000
0.055 0.658 0.725
0.688 0.342 0.046
0.342 0.411 0.345
0.046 0.345 0.962
import Jama.*;
class CholeskyDecompositionTest
{
public static void main(String args[])
{
double [][] array=new double[3][3];
int i,j;
for(i=0;i<3;i++)
for(j=0;j<=i;j++){
array[i][j]=Math.random();
array[j][i]=array[i][j];}
Matrix A=new Matrix(array);
CholeskyDecomposition cd=new CholeskyDecomposition(A);
System.out.println("A=");A.print(6,3);
Matrix L=cd.getL();
System.out.println("L=");L.print(6,3);
if (cd.isSPD())
{L.times(L.transpose()).print(6,3);}
}
}
import Jama.*;
class CholeskyDecompositionTest
{
public static void main(String args[])
{
double [][] array=new double[3][3];
int i,j;
for(i=0;i<3;i++)
for(j=0;j<=i;j++){
array[i][j]=Math.random();
array[j][i]=array[i][j];}
Matrix A=new Matrix(array);
CholeskyDecomposition cd=new CholeskyDecomposition(A);
System.out.println("A=");A.print(6,3);
Matrix L=cd.getL();
System.out.println("L=");L.print(6,3);
if (cd.isSPD())
{L.times(L.transpose()).print(6,3);}
}
}
© 2011 Frank Nielsen
Application of Cholesky decomposition :
A multivariate normal
Box-Muller transform for standard normal variate :
U1,U2 are independent uniform distributions (Math.random())
Multivariate normal density :
© 2011 Frank Nielsen
import Jama.*;
class Gaussian
{
int dim; // dimension
Matrix mu; // mean
Matrix Sigma; // variance-covariance matrix
Matrix A; // Auxiliary for Cholesky decomposition
Matrix Precision; // Auxiliary for inverse of the covariance matrix
// Constructor
Gaussian(Matrix m,Matrix S){
this.Sigma=S;
...
CholeskyDecomposition cd=new CholeskyDecomposition(Sigma);
this.A=cd.getL(); // Sigma=L L'
}
// Draw a normal variate
Matrix draw(){
Matrix x=new Matrix(dim,1); // column vector
for(int i=0;i<dim;i++)
{double u1=Math.random();
double u2=Math.random();
// Box-Muller transform
double r=Math.sqrt(-2.0*Math.log(u1))*Math.sin(2.0*Math.PI*u2);
x.set(i,0,r);}
return mu.plus(A.times(x));
}

Más contenido relacionado

La actualidad más candente

Dimension Reduction And Visualization Of Large High Dimensional Data Via Inte...
Dimension Reduction And Visualization Of Large High Dimensional Data Via Inte...Dimension Reduction And Visualization Of Large High Dimensional Data Via Inte...
Dimension Reduction And Visualization Of Large High Dimensional Data Via Inte...
wl820609
 
Particle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer VisionParticle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer Vision
zukun
 
Manifold learning with application to object recognition
Manifold learning with application to object recognitionManifold learning with application to object recognition
Manifold learning with application to object recognition
zukun
 

La actualidad más candente (20)

Dimension Reduction And Visualization Of Large High Dimensional Data Via Inte...
Dimension Reduction And Visualization Of Large High Dimensional Data Via Inte...Dimension Reduction And Visualization Of Large High Dimensional Data Via Inte...
Dimension Reduction And Visualization Of Large High Dimensional Data Via Inte...
 
010_20160216_Variational Gaussian Process
010_20160216_Variational Gaussian Process010_20160216_Variational Gaussian Process
010_20160216_Variational Gaussian Process
 
Pre-computation for ABC in image analysis
Pre-computation for ABC in image analysisPre-computation for ABC in image analysis
Pre-computation for ABC in image analysis
 
Clustering introduction
Clustering introductionClustering introduction
Clustering introduction
 
Lecture 3 image sampling and quantization
Lecture 3 image sampling and quantizationLecture 3 image sampling and quantization
Lecture 3 image sampling and quantization
 
Pixel RNN to Pixel CNN++
Pixel RNN to Pixel CNN++Pixel RNN to Pixel CNN++
Pixel RNN to Pixel CNN++
 
06 mlp
06 mlp06 mlp
06 mlp
 
Weisfeiler and Leman Go Neural: Higher-order Graph Neural Networks
Weisfeiler and Leman Go Neural: Higher-order Graph Neural Networks Weisfeiler and Leman Go Neural: Higher-order Graph Neural Networks
Weisfeiler and Leman Go Neural: Higher-order Graph Neural Networks
 
Multidimension Scaling and Isomap
Multidimension Scaling and IsomapMultidimension Scaling and Isomap
Multidimension Scaling and Isomap
 
Convolutional Neural Networks (DLAI D5L1 2017 UPC Deep Learning for Artificia...
Convolutional Neural Networks (DLAI D5L1 2017 UPC Deep Learning for Artificia...Convolutional Neural Networks (DLAI D5L1 2017 UPC Deep Learning for Artificia...
Convolutional Neural Networks (DLAI D5L1 2017 UPC Deep Learning for Artificia...
 
Glocalized Weisfeiler-Lehman Graph Kernels: Global-Local Feature Maps of Graphs
Glocalized Weisfeiler-Lehman Graph Kernels: Global-Local Feature Maps of Graphs Glocalized Weisfeiler-Lehman Graph Kernels: Global-Local Feature Maps of Graphs
Glocalized Weisfeiler-Lehman Graph Kernels: Global-Local Feature Maps of Graphs
 
Recent Advances in Kernel-Based Graph Classification
Recent Advances in Kernel-Based Graph ClassificationRecent Advances in Kernel-Based Graph Classification
Recent Advances in Kernel-Based Graph Classification
 
Particle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer VisionParticle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer Vision
 
Manifold learning with application to object recognition
Manifold learning with application to object recognitionManifold learning with application to object recognition
Manifold learning with application to object recognition
 
Lecture 5: Neural Networks II
Lecture 5: Neural Networks IILecture 5: Neural Networks II
Lecture 5: Neural Networks II
 
V2 v posenet
V2 v posenetV2 v posenet
V2 v posenet
 
Introduction to Deep Learning and Tensorflow
Introduction to Deep Learning and TensorflowIntroduction to Deep Learning and Tensorflow
Introduction to Deep Learning and Tensorflow
 
Lecture 5 Relationship between pixel-2
Lecture 5 Relationship between pixel-2Lecture 5 Relationship between pixel-2
Lecture 5 Relationship between pixel-2
 
Machine learning applications in aerospace domain
Machine learning applications in aerospace domainMachine learning applications in aerospace domain
Machine learning applications in aerospace domain
 
Object Detection Beyond Mask R-CNN and RetinaNet III
Object Detection Beyond Mask R-CNN and RetinaNet IIIObject Detection Beyond Mask R-CNN and RetinaNet III
Object Detection Beyond Mask R-CNN and RetinaNet III
 

Destacado

Point elementary school team- taylor, sophia and mckenna-basket of hope-3031
Point elementary school team- taylor, sophia and mckenna-basket of hope-3031Point elementary school team- taylor, sophia and mckenna-basket of hope-3031
Point elementary school team- taylor, sophia and mckenna-basket of hope-3031
SuperServiceChallenge2013
 
Jonathan Sy | When Shit Hits the Fan
Jonathan Sy | When Shit Hits the FanJonathan Sy | When Shit Hits the Fan
Jonathan Sy | When Shit Hits the Fan
CM1TO
 
Point elementary team- grant, jivaj, and braeden-basket of hope-2815
Point elementary   team- grant, jivaj, and braeden-basket of hope-2815Point elementary   team- grant, jivaj, and braeden-basket of hope-2815
Point elementary team- grant, jivaj, and braeden-basket of hope-2815
SuperServiceChallenge2013
 
Point elementary team- natalie, andrea and katie-basket of hope-2783
Point elementary   team- natalie, andrea and katie-basket of hope-2783Point elementary   team- natalie, andrea and katie-basket of hope-2783
Point elementary team- natalie, andrea and katie-basket of hope-2783
SuperServiceChallenge2013
 
Point elementary school team- vinnie, aniimesh, and namari-basket of hope-3025
Point elementary school team- vinnie, aniimesh, and namari-basket of hope-3025Point elementary school team- vinnie, aniimesh, and namari-basket of hope-3025
Point elementary school team- vinnie, aniimesh, and namari-basket of hope-3025
SuperServiceChallenge2013
 
Point elementary team- adam, chase and ryan-basket of hope-2813
Point elementary   team- adam, chase and ryan-basket of hope-2813Point elementary   team- adam, chase and ryan-basket of hope-2813
Point elementary team- adam, chase and ryan-basket of hope-2813
SuperServiceChallenge2013
 
Defender the mc call family-kids against hunger-3561
Defender  the mc call family-kids against hunger-3561Defender  the mc call family-kids against hunger-3561
Defender the mc call family-kids against hunger-3561
SuperServiceChallenge2013
 
Big Data in the small and medium enterprise, Funnelback UK
Big Data in the small and medium enterprise, Funnelback UKBig Data in the small and medium enterprise, Funnelback UK
Big Data in the small and medium enterprise, Funnelback UK
Internet World
 
Erin Bury | It's Not Me, It's You: How to Turn Content From Promotional to Mu...
Erin Bury | It's Not Me, It's You: How to Turn Content From Promotional to Mu...Erin Bury | It's Not Me, It's You: How to Turn Content From Promotional to Mu...
Erin Bury | It's Not Me, It's You: How to Turn Content From Promotional to Mu...
CM1TO
 
Point elemtary team- nick, sean and rachel-basket of hope-2769
Point elemtary   team- nick, sean and rachel-basket of hope-2769Point elemtary   team- nick, sean and rachel-basket of hope-2769
Point elemtary team- nick, sean and rachel-basket of hope-2769
SuperServiceChallenge2013
 

Destacado (20)

Point elementary school team- taylor, sophia and mckenna-basket of hope-3031
Point elementary school team- taylor, sophia and mckenna-basket of hope-3031Point elementary school team- taylor, sophia and mckenna-basket of hope-3031
Point elementary school team- taylor, sophia and mckenna-basket of hope-3031
 
Jonathan Sy | When Shit Hits the Fan
Jonathan Sy | When Shit Hits the FanJonathan Sy | When Shit Hits the Fan
Jonathan Sy | When Shit Hits the Fan
 
Point elementary team- grant, jivaj, and braeden-basket of hope-2815
Point elementary   team- grant, jivaj, and braeden-basket of hope-2815Point elementary   team- grant, jivaj, and braeden-basket of hope-2815
Point elementary team- grant, jivaj, and braeden-basket of hope-2815
 
Point elementary team- natalie, andrea and katie-basket of hope-2783
Point elementary   team- natalie, andrea and katie-basket of hope-2783Point elementary   team- natalie, andrea and katie-basket of hope-2783
Point elementary team- natalie, andrea and katie-basket of hope-2783
 
Point elementary school team- vinnie, aniimesh, and namari-basket of hope-3025
Point elementary school team- vinnie, aniimesh, and namari-basket of hope-3025Point elementary school team- vinnie, aniimesh, and namari-basket of hope-3025
Point elementary school team- vinnie, aniimesh, and namari-basket of hope-3025
 
Point elementary team- adam, chase and ryan-basket of hope-2813
Point elementary   team- adam, chase and ryan-basket of hope-2813Point elementary   team- adam, chase and ryan-basket of hope-2813
Point elementary team- adam, chase and ryan-basket of hope-2813
 
(slides 7) Visual Computing: Geometry, Graphics, and Vision
(slides 7) Visual Computing: Geometry, Graphics, and Vision(slides 7) Visual Computing: Geometry, Graphics, and Vision
(slides 7) Visual Computing: Geometry, Graphics, and Vision
 
(slides 9) Visual Computing: Geometry, Graphics, and Vision
(slides 9) Visual Computing: Geometry, Graphics, and Vision(slides 9) Visual Computing: Geometry, Graphics, and Vision
(slides 9) Visual Computing: Geometry, Graphics, and Vision
 
(ISIA 4) Cours d'algorithmique (1995)
(ISIA 4) Cours d'algorithmique (1995)(ISIA 4) Cours d'algorithmique (1995)
(ISIA 4) Cours d'algorithmique (1995)
 
On Clustering Histograms with k-Means by Using Mixed α-Divergences
 On Clustering Histograms with k-Means by Using Mixed α-Divergences On Clustering Histograms with k-Means by Using Mixed α-Divergences
On Clustering Histograms with k-Means by Using Mixed α-Divergences
 
Defender the mc call family-kids against hunger-3561
Defender  the mc call family-kids against hunger-3561Defender  the mc call family-kids against hunger-3561
Defender the mc call family-kids against hunger-3561
 
Big Data in the small and medium enterprise, Funnelback UK
Big Data in the small and medium enterprise, Funnelback UKBig Data in the small and medium enterprise, Funnelback UK
Big Data in the small and medium enterprise, Funnelback UK
 
Erin Bury | It's Not Me, It's You: How to Turn Content From Promotional to Mu...
Erin Bury | It's Not Me, It's You: How to Turn Content From Promotional to Mu...Erin Bury | It's Not Me, It's You: How to Turn Content From Promotional to Mu...
Erin Bury | It's Not Me, It's You: How to Turn Content From Promotional to Mu...
 
Computational Information Geometry: A quick review (ICMS)
Computational Information Geometry: A quick review (ICMS)Computational Information Geometry: A quick review (ICMS)
Computational Information Geometry: A quick review (ICMS)
 
Dots in blue water eem:dibw-1387
Dots in blue water eem:dibw-1387Dots in blue water eem:dibw-1387
Dots in blue water eem:dibw-1387
 
Slides: Simplifying Gaussian Mixture Models Via Entropic Quantization (EUSIPC...
Slides: Simplifying Gaussian Mixture Models Via Entropic Quantization (EUSIPC...Slides: Simplifying Gaussian Mixture Models Via Entropic Quantization (EUSIPC...
Slides: Simplifying Gaussian Mixture Models Via Entropic Quantization (EUSIPC...
 
Dots in blue water eem:dibw-1396
Dots in blue water eem:dibw-1396Dots in blue water eem:dibw-1396
Dots in blue water eem:dibw-1396
 
Point elemtary team- nick, sean and rachel-basket of hope-2769
Point elemtary   team- nick, sean and rachel-basket of hope-2769Point elemtary   team- nick, sean and rachel-basket of hope-2769
Point elemtary team- nick, sean and rachel-basket of hope-2769
 
N:a big class-1916
N:a big class-1916N:a big class-1916
N:a big class-1916
 
(chapter 2) A Concise and Practical Introduction to Programming Algorithms in...
(chapter 2) A Concise and Practical Introduction to Programming Algorithms in...(chapter 2) A Concise and Practical Introduction to Programming Algorithms in...
(chapter 2) A Concise and Practical Introduction to Programming Algorithms in...
 

Similar a (slides 2) Visual Computing: Geometry, Graphics, and Vision

Convolution Neural Network Lecture Slides
Convolution Neural Network Lecture SlidesConvolution Neural Network Lecture Slides
Convolution Neural Network Lecture Slides
AdnanHaider234505
 
UNetEliyaLaialy (2).pptx
UNetEliyaLaialy (2).pptxUNetEliyaLaialy (2).pptx
UNetEliyaLaialy (2).pptx
NoorUlHaq47
 
Tracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance systemTracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance system
iaemedu
 
Tracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance systemTracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance system
iaemedu
 
Tracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance systemTracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance system
IAEME Publication
 
Tracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance systemTracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance system
iaemedu
 
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
mercysuttle
 

Similar a (slides 2) Visual Computing: Geometry, Graphics, and Vision (20)

Convolution Neural Network Lecture Slides
Convolution Neural Network Lecture SlidesConvolution Neural Network Lecture Slides
Convolution Neural Network Lecture Slides
 
Diving into Deep Learning (Silicon Valley Code Camp 2017)
Diving into Deep Learning (Silicon Valley Code Camp 2017)Diving into Deep Learning (Silicon Valley Code Camp 2017)
Diving into Deep Learning (Silicon Valley Code Camp 2017)
 
Android and Deep Learning
Android and Deep LearningAndroid and Deep Learning
Android and Deep Learning
 
C++ and Deep Learning
C++ and Deep LearningC++ and Deep Learning
C++ and Deep Learning
 
Convolutional Neural Network (CNN)of Deep Learning
Convolutional Neural Network (CNN)of Deep LearningConvolutional Neural Network (CNN)of Deep Learning
Convolutional Neural Network (CNN)of Deep Learning
 
CNN.pptx
CNN.pptxCNN.pptx
CNN.pptx
 
Tutorial on convolutional neural networks
Tutorial on convolutional neural networksTutorial on convolutional neural networks
Tutorial on convolutional neural networks
 
UNetEliyaLaialy (2).pptx
UNetEliyaLaialy (2).pptxUNetEliyaLaialy (2).pptx
UNetEliyaLaialy (2).pptx
 
Scala and Deep Learning
Scala and Deep LearningScala and Deep Learning
Scala and Deep Learning
 
Tracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance systemTracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance system
 
Tracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance systemTracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance system
 
Tracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance systemTracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance system
 
Tracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance systemTracking and counting human in visual surveillance system
Tracking and counting human in visual surveillance system
 
nlp dl 1.pdf
nlp dl 1.pdfnlp dl 1.pdf
nlp dl 1.pdf
 
Deep Learning, Keras, and TensorFlow
Deep Learning, Keras, and TensorFlowDeep Learning, Keras, and TensorFlow
Deep Learning, Keras, and TensorFlow
 
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
 
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
 
TypeScript and Deep Learning
TypeScript and Deep LearningTypeScript and Deep Learning
TypeScript and Deep Learning
 
Log polar coordinates
Log polar coordinatesLog polar coordinates
Log polar coordinates
 
Introduction to convolutional networks .pptx
Introduction to convolutional networks .pptxIntroduction to convolutional networks .pptx
Introduction to convolutional networks .pptx
 

Último

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Último (20)

Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 

(slides 2) Visual Computing: Geometry, Graphics, and Vision

  • 1. © 2011 Frank Nielsen INF555 Fundamentals of 3D Lecture 1 Follow-up: Connected Components Lecture 2: Convolutions and Filters Matrix decompositions Frank Nielsen 21 Septembre 2011
  • 2. © 2011 Frank Nielsen Labelling connected components (Union-Find) Input: binary image Foreground/Background pixels Output: Each connected component Extracting one component
  • 3. © 2011 Frank Nielsen Useful in computer vision... → Image segmentation How many (large) objects?
  • 4. © 2011 Frank Nielsen A simple algorithm Initially each pixel defines its own region (labelled by say the pixel index: x+y*width) Scan the image from left to right and top to bottom: If current pixel is background AND East pixel is background: Merge their regions into one = « connect » them If current pixel is background AND South pixel is background: Merge their regions into one = « connect » them Extract regions (floodfilling or single pass algorithm) Initially each pixel defines its own region (labelled by say the pixel index: x+y*width) Scan the image from left to right and top to bottom: If current pixel is background AND East pixel is background: Merge their regions into one = « connect » them If current pixel is background AND South pixel is background: Merge their regions into one = « connect » them Extract regions (floodfilling or single pass algorithm) How do we merge quickly disjoint sets?
  • 5. © 2011 Frank Nielsen Union-Find abstract data-structures c RANK=DEPTH Visual Depiction
  • 6. © 2011 Frank Nielsen class UnionFind{ int [ ] rank; int [ ] parent; UnionFind(int n) {int k; parent=new int[n]; rank=new int[n]; for (k = 0; k < n; k++) {parent[k] = k; rank[k] = 0; } } int Find(int k) {while (parent[k]!=k ) k=parent[k]; return k;} int Union(int x, int y) { x=Find(x);y=Find(y); if ( x == y ) return -1; // Do not perform union of same set if (rank[x] > rank[y]) {parent[y]=x; return x;} else { parent[x]=y; if (rank[x]==rank[y]) rank[y]++;return y;} } } c // Attach tree(y) to tree(x) // else // Attach tree(x) to tree(y) and if same depth, then increase depth of y by one // Attach tree(y) to tree(x) // else // Attach tree(x) to tree(y) and if same depth, then increase depth of y by one
  • 7. © 2011 Frank Nielsen ● Variable name aliases. • Pixels in a digital photo. • Computers in a network. • Web pages on the Internet. • Transistors in a computer chip. Many applications of the union-find data-structure
  • 8. © 2011 Frank Nielsen Yet another example of UF/segmentation: Inbetweening for cell animation http://www.vuse.vanderbilt.edu/~bobbyb/pubs/sca06.html
  • 9. © 2011 Frank Nielsen Minimum Spanning Tree (Kruskal's algorithm) http://en.wikipedia.org/wiki/Minimum_spanning_tree http://en.wikipedia.org/wiki/Kruskal's_algorithm Implemented using Union-Find data structure
  • 10. © 2011 Frank Nielsen Intensity=0.3red+0.59green+0.11blue Convolutions et filtres Color image Grey image
  • 11. © 2011 Frank Nielsen Image Convolution Roberts Cross (edge) detection Discrete gradient (maximal response for edge at 45 degrees) The two filters are 90 degrees apart (inner product is zero) Approximated by
  • 12. © 2011 Frank Nielsen Roberts Cross edge detector Approximated by Input Filter response (x5) Thresholded
  • 13. © 2011 Frank Nielsen Sobel edge detector Approximated by
  • 14. © 2011 Frank Nielsen Sobel Roberts Crossl http://homepages.inf.ed.ac.uk/rbf/HIPR2/sobeldemo.htm
  • 15. © 2011 Frank Nielsen Gaussian smoothing Normalize discrete Gaussian kernel to 1 Two parameters to tune: ● K, the dimension of the matric ● Sigma, the smoothing width...
  • 16. © 2011 Frank Nielsen Blurring, low-pass filter eliminates edges... Source Sigma=1, 5x5 Sigma=2, 9x9 Sigma=4, 15x15
  • 17. © 2011 Frank Nielsen Mean filter= Uniform average Source Corrupted, Gaussian noise (sigma=8) Mean filter 3x3
  • 18. © 2011 Frank Nielsen Corrupted, Gaussian noise (sigma=13) Mean filter= Uniform average Source Mean filter 3x3
  • 19. © 2011 Frank Nielsen Median filter Source Median filter 3x3Corrupted, Gaussian noise (sigma=8)
  • 20. © 2011 Frank Nielsen Sharpening: Identity+Laplacian kernel Source image
  • 21. © 2011 Frank Nielsen Bilateral filtering Traditional spatial gaussian filtering
  • 22. © 2011 Frank Nielsen Bilateral filtering New! gaussian on the intensity difference filtering Bilateral Filtering for Gray and Color Images, Tomasi and Manduchi 1998 .... SUSAN feature extractor...
  • 23. © 2011 Frank Nielsen * * * input output Same Gaussian kernel everywhere. Bilateral filtering Traditional spatial gaussian filtering
  • 24. © 2011 Frank Nielsen * * * input output The kernel shape depends on the image content. space weight not new range weight I new normalization factor new ( ) ( )∑∈ −−= S IIIGG W IBF q qqp p p qp |||||| 1 ][ rs σσ
  • 25. © 2011 Frank Nielsen Bilateral filtering l Example of Bilateral filtering l Low contrast texture has been removed ● Brute-force implementation is slow > 10min (but real-time with GPU and better algorithms)
  • 26. © 2011 Frank Nielsen Originimage Bilateral(3) Bilateral filtering
  • 27. © 2011 Frank Nielsen Results OriginImage Oneiteration fiveiterations Bootstrapping http://people.csail.mit.edu/sparis/siggraph07_course/
  • 28. © 2011 Frank Nielsen Bilateral mesh denoising Bilateral filtering extends to meshes Source
  • 29. © 2011 Frank Nielsen Harris-Stephens edge detector: Feature points Aim at finding good feature
  • 30. © 2011 Frank Nielsen Harris-Stephens edge detector Measure the corner response as Algorithm: – Find points with large corner response function R (R > threshold) – Take the points of local maxima of R
  • 31. © 2011 Frank Nielsen Harris-Stephens edge detector Corner response R
  • 32. © 2011 Frank Nielsen Thresholding R>cste Local maxima of R
  • 33. © 2011 Frank Nielsen Superposing local maxima on source images
  • 34. © 2011 Frank Nielsen Invariant to orientation but Depends on the scaling of the image
  • 35. © 2011 Frank Nielsen http://www.ptgui.com/download.html Application to feature matching for image panorama tools
  • 36. © 2011 Frank Nielsen Matrix operations using JAMA
  • 37. © 2011 Frank Nielsen Use JAMA library http://math.nist.gov/javanumerics/jama/ JAMA : A Java Matrix Package javac -classpath Jama-1.0.2.jar filename.java Using JCreator
  • 38. © 2011 Frank Nielsen http://www.bluebit.gr/matrix-calculator/ Write a class wrapper around Jama Essential operations are:
  • 39. © 2011 Frank Nielsen LU Decomposition of rectangular matrices Product of a lower and upper triangular matrices
  • 40. © 2011 Frank Nielsen P permutation matrix LU Decomposition for solving linear systems: LU Decomposition of rectangular matrices Trivial to solve since L is lower triangular matrix
  • 41. © 2011 Frank Nielsen Matrix A=Matrix.random(3,3); Matrix b = Matrix.random(3,1); Matrix x= A.solve(b); System.out.println("A="); A.print(6,3); System.out.println("b="); b.print(6,3); System.out.println("x="); x.print(6,3); LUDecomposition luDecomp=A.lu(); Matrix L=luDecomp.getL(); Matrix U=luDecomp.getU(); int [ ] pivot= luDecomp.getPivot(); System.out.println("L="); L.print(6,3); System.out.println("U="); U.print(6,3); for(int i=0;i<pivot.length;i++) System.out.print(pivot[i]+" "); System.out.println(""); A= 0.345 0.090 0.599 0.932 0.428 0.703 0.420 0.089 0.439 b= 0.342 0.192 0.806 x= 4.432 -7.913 -0.791 L= 1.000 0.000 0.000 0.450 1.000 0.000 0.370 0.660 1.000 U= 0.932 0.428 0.703 0.000 -0.103 0.122 0.000 0.000 0.258 1 2 0 A= 0.345 0.090 0.599 0.932 0.428 0.703 0.420 0.089 0.439 b= 0.342 0.192 0.806 x= 4.432 -7.913 -0.791 L= 1.000 0.000 0.000 0.450 1.000 0.000 0.370 0.660 1.000 U= 0.932 0.428 0.703 0.000 -0.103 0.122 0.000 0.000 0.258 1 2 0
  • 42. © 2011 Frank Nielsen QR Decomposition Q: Orthogonal matrix R: Upper triangular matrix A= 0.821 0.098 0.374 0.057 0.151 0.036 0.994 0.150 0.703 Q= -0.637 0.131 0.760 -0.044 -0.990 0.134 -0.770 -0.052 -0.636 R= -1.290 -0.185 -0.781 0.000 -0.145 -0.023 0.000 0.000 -0.158 A= 0.821 0.098 0.374 0.057 0.151 0.036 0.994 0.150 0.703 Q= -0.637 0.131 0.760 -0.044 -0.990 0.134 -0.770 -0.052 -0.636 R= -1.290 -0.185 -0.781 0.000 -0.145 -0.023 0.000 0.000 -0.158 import Jama.*; class QRDecompositionTest { public static void main(String args[]) { Matrix A=Matrix.random(3,3); QRDecomposition qr=new QRDecomposition(A); System.out.println("A=");A.print(6,3); Matrix Q=qr.getQ(); System.out.println("Q=");Q.print(6,3); Matrix R=qr.getR(); System.out.println("R=");R.print(6,3); } } import Jama.*; class QRDecompositionTest { public static void main(String args[]) { Matrix A=Matrix.random(3,3); QRDecomposition qr=new QRDecomposition(A); System.out.println("A=");A.print(6,3); Matrix Q=qr.getQ(); System.out.println("Q=");Q.print(6,3); Matrix R=qr.getR(); System.out.println("R=");R.print(6,3); } } Useful for solving least squares problem
  • 43. © 2011 Frank Nielsen Cholesky decomposition For a symmetric positive definite matrix A, Cholesky decomposition yields: L is a lower triangular matrix L* is the conjugate transpose
  • 44. © 2011 Frank Nielsen A= 0.688 0.342 0.046 0.342 0.411 0.345 0.046 0.345 0.962 L= 0.829 0.000 0.000 0.412 0.491 0.000 0.055 0.658 0.725 0.688 0.342 0.046 0.342 0.411 0.345 0.046 0.345 0.962 A= 0.688 0.342 0.046 0.342 0.411 0.345 0.046 0.345 0.962 L= 0.829 0.000 0.000 0.412 0.491 0.000 0.055 0.658 0.725 0.688 0.342 0.046 0.342 0.411 0.345 0.046 0.345 0.962 import Jama.*; class CholeskyDecompositionTest { public static void main(String args[]) { double [][] array=new double[3][3]; int i,j; for(i=0;i<3;i++) for(j=0;j<=i;j++){ array[i][j]=Math.random(); array[j][i]=array[i][j];} Matrix A=new Matrix(array); CholeskyDecomposition cd=new CholeskyDecomposition(A); System.out.println("A=");A.print(6,3); Matrix L=cd.getL(); System.out.println("L=");L.print(6,3); if (cd.isSPD()) {L.times(L.transpose()).print(6,3);} } } import Jama.*; class CholeskyDecompositionTest { public static void main(String args[]) { double [][] array=new double[3][3]; int i,j; for(i=0;i<3;i++) for(j=0;j<=i;j++){ array[i][j]=Math.random(); array[j][i]=array[i][j];} Matrix A=new Matrix(array); CholeskyDecomposition cd=new CholeskyDecomposition(A); System.out.println("A=");A.print(6,3); Matrix L=cd.getL(); System.out.println("L=");L.print(6,3); if (cd.isSPD()) {L.times(L.transpose()).print(6,3);} } }
  • 45. © 2011 Frank Nielsen Application of Cholesky decomposition : A multivariate normal Box-Muller transform for standard normal variate : U1,U2 are independent uniform distributions (Math.random()) Multivariate normal density :
  • 46. © 2011 Frank Nielsen import Jama.*; class Gaussian { int dim; // dimension Matrix mu; // mean Matrix Sigma; // variance-covariance matrix Matrix A; // Auxiliary for Cholesky decomposition Matrix Precision; // Auxiliary for inverse of the covariance matrix // Constructor Gaussian(Matrix m,Matrix S){ this.Sigma=S; ... CholeskyDecomposition cd=new CholeskyDecomposition(Sigma); this.A=cd.getL(); // Sigma=L L' } // Draw a normal variate Matrix draw(){ Matrix x=new Matrix(dim,1); // column vector for(int i=0;i<dim;i++) {double u1=Math.random(); double u2=Math.random(); // Box-Muller transform double r=Math.sqrt(-2.0*Math.log(u1))*Math.sin(2.0*Math.PI*u2); x.set(i,0,r);} return mu.plus(A.times(x)); }