SlideShare a Scribd company logo
1 of 54
Allan caine adcaine@cs.uwaterloo.ca http://www.cs.uwaterloo.ca/~adcaine/ May 28, 2009 Chroma Keying using Gaussian Mixture Models (GMMs)
Expectations Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 2 You should take notes in case this material appears on an exam or assignment, possibly in a different form It is expected that you will use the Matlab software found at http://www.cs.uwaterloo.ca/~adcaine/ to generate a toy problem and solve it These lecture notes are on-line at the above address
Inspiration Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 3 Have you ever wondered how is this done?  Can we emulate this process on a computer?
Co-ordination Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 4 By viewing an off-camera monitor, theweather announcer can co-ordinate herhand movements with the background.The result is a seemingly realistic televisionbroadcast, in spite of the fact that theannouncer is not actually in front of anyweather map.
Teaching Objectives Describe how chroma keying (blue screening) works Theorize how classification might solve the chroma keying problem on a computer Enumerate the axioms of probability  Explain the concept behind digital images Express the intuition behind the Expectation-Maximization algorithm in terms of a Gaussian Mixture Model (GMM), using the definition of a Gaussian. Generate a toy GMM problem, and solve the toy problem, recovering the hidden variables 5 Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/
Outline Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 6 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
Chroma Keying and our Assumptions Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 7 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
Basic Idea behind Chroma Keying Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 8 If the background is of one color, saygreen, and the foreground person is notof that color, then the person can besegmented from the background.The person can then be superimposed on abackground of our choosing. Normally, the chroma key is assumed to beknown.  To make this problem moreinteresting, we will assume that the chromakey is unknown, and must be learned.  So,it’s an AI problem.
Assumptions for the Segmentation Problem Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 9 We want to segment the foreground from the background There is a background of a single color However, the background color is unknown; the background color must be learned No part of the person or object in the foreground has the background color The foreground person or object can be in any position in the image; we cannot deduce the background color simply by examining a pixel in a certain fixed position
RBG Color Model Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 10 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
Explanation of RGB Color Model Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 11 Every color is expressed as an ordered triple Each value can be between 0 and 255; i.e. 256 possibilities  8 bits can store 256 possibilities The numbers represent the amounts of red, green, and blue in that order  (R,G,B) If R = G = B, then the pixel is a shade of gray
RGB as a Data Structure in Matlab Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 12
Scatter Diagrams Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 13 If only we could determine which class a pixel belonged to:  foreground orbackground; the purple sphere or the green background, respectively.
Make your own Scatter Plot Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 14
Actual Scatter Plot Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 15
Axioms of Probability Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 16 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
 (Some) Axioms of Probability Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 17
Bayesian Philosophy of Choosing Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 18 Suppose two events, A and B, occur with probability P(A) and P(B) such that P(A) + P(B) = 1. If you had to place a bet on which event would occur and if P(A) ≠ P(B), what event would you bet on? Suppose P(A) = P(B).  What event would you bet on?
Gaussian Distributions Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 19 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
Gaussian Distributions Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 20
One-D Gaussian Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 21
Variations in μ Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 22
Variations in σ Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 23
2D Gaussian Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 24
Comparison of two 2D Gaussians Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 25
2D Gaussian with σx ≠ σy Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 26
3D Gaussian Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 27
Gaussian Mixture Model (GMM) Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 28 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
GMM Model Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 29 The number of classes is known Each class has a particular mean and variance Each class has a mixing (or membership) weight.  All mixing weights add up to one
Toy Problem Parameters Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 30
Generating the Toy Problem’s DataSet Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 31 20% 40% Start 40%
The GMM Problem Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 32 ??% ??% Start ??%
Bayes’ Rule and the Expectation Step Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 33 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
Bayes’ Rule Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 34 The likelihood of A given B A prior probability on B The likelihood of B given A A normalization constant
The Main of Idea of GMMs:  E-Step Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 35 The probability of position j havinga pixel with values x given class i. Basically, evaluate a Gaussian at xusing μi and Σi as parameters The probability that position j is generatedby class 1 or 2:  foreground or background The prior probability ofclass i; i.e. the mixing weights Essentially, a normalization constantto ensure that P(C=1|xj) +P(C=2|xj) = 1for j fixed.
Update Rules and the Maximization Step Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 36 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
Update Rules:  M-Step Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 37 In words, define what each ofthese mathematical statementsmean. What do you think is the intuitionbehind these three update rules?
Solving a Toy Problem Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 38 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
Toy Problem Visually Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 39
Typical Output Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 40 Class 2 Class 3 Class 1
Solution to the Toy Problem Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 41
Comparison of Statistics Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 42
Recovery of the Model Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 43
3D GMM Problem Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 44
Segmentation using a GMM and Masks Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 45 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
Segmentation Example Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 46
Segmentation Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 47 The upshot of all of this is that the foreground has a parameterization of: The novelty of this result is that we have a complete and numericalcharacterization of the image without knowing beforehand thecolor of the background.  These parameters have been learned.
Producing the Mask Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 48 A Gaussian computed using themean and variance of the foregroundclass. The mixing weight 0.9695 A Gaussian computed using themean and variance of the backgroundclass. The mixing weight 0.0305 How would we use a Bayesian philosophy to decide ifa pixel represents the foreground or background?
Masks Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 49 This mask permits the sphereto show through while excludingthe background.  It’s used tosegment the sphere; that is,segment out the foreground. This mask is the logical complementof the first mask.  It indicates wherethe background pixels can be found.This mask is used to prepare the newbackground so that it may becombined with the foreground.
Using the Masks for the Foreground and Background Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 50
Adding the Images Together Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 51
Before and After Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 52 Before After
Further Work Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 53 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
Further Work Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 54 Complex foregrounds and backgrounds Tracking objects Speeding up processing Sampling Smoothing the transition from background to foreground to avoid ragged edges Using alternative color spaces such as Hue-Saturation-Value (HSV) for better classification

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Image Segmentation Using Gm Ms

  • 1. Allan caine adcaine@cs.uwaterloo.ca http://www.cs.uwaterloo.ca/~adcaine/ May 28, 2009 Chroma Keying using Gaussian Mixture Models (GMMs)
  • 2. Expectations Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 2 You should take notes in case this material appears on an exam or assignment, possibly in a different form It is expected that you will use the Matlab software found at http://www.cs.uwaterloo.ca/~adcaine/ to generate a toy problem and solve it These lecture notes are on-line at the above address
  • 3. Inspiration Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 3 Have you ever wondered how is this done? Can we emulate this process on a computer?
  • 4. Co-ordination Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 4 By viewing an off-camera monitor, theweather announcer can co-ordinate herhand movements with the background.The result is a seemingly realistic televisionbroadcast, in spite of the fact that theannouncer is not actually in front of anyweather map.
  • 5. Teaching Objectives Describe how chroma keying (blue screening) works Theorize how classification might solve the chroma keying problem on a computer Enumerate the axioms of probability Explain the concept behind digital images Express the intuition behind the Expectation-Maximization algorithm in terms of a Gaussian Mixture Model (GMM), using the definition of a Gaussian. Generate a toy GMM problem, and solve the toy problem, recovering the hidden variables 5 Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/
  • 6. Outline Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 6 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 7. Chroma Keying and our Assumptions Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 7 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 8. Basic Idea behind Chroma Keying Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 8 If the background is of one color, saygreen, and the foreground person is notof that color, then the person can besegmented from the background.The person can then be superimposed on abackground of our choosing. Normally, the chroma key is assumed to beknown. To make this problem moreinteresting, we will assume that the chromakey is unknown, and must be learned. So,it’s an AI problem.
  • 9. Assumptions for the Segmentation Problem Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 9 We want to segment the foreground from the background There is a background of a single color However, the background color is unknown; the background color must be learned No part of the person or object in the foreground has the background color The foreground person or object can be in any position in the image; we cannot deduce the background color simply by examining a pixel in a certain fixed position
  • 10. RBG Color Model Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 10 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 11. Explanation of RGB Color Model Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 11 Every color is expressed as an ordered triple Each value can be between 0 and 255; i.e. 256 possibilities  8 bits can store 256 possibilities The numbers represent the amounts of red, green, and blue in that order  (R,G,B) If R = G = B, then the pixel is a shade of gray
  • 12. RGB as a Data Structure in Matlab Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 12
  • 13. Scatter Diagrams Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 13 If only we could determine which class a pixel belonged to: foreground orbackground; the purple sphere or the green background, respectively.
  • 14. Make your own Scatter Plot Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 14
  • 15. Actual Scatter Plot Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 15
  • 16. Axioms of Probability Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 16 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 17. (Some) Axioms of Probability Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 17
  • 18. Bayesian Philosophy of Choosing Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 18 Suppose two events, A and B, occur with probability P(A) and P(B) such that P(A) + P(B) = 1. If you had to place a bet on which event would occur and if P(A) ≠ P(B), what event would you bet on? Suppose P(A) = P(B). What event would you bet on?
  • 19. Gaussian Distributions Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 19 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 20. Gaussian Distributions Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 20
  • 21. One-D Gaussian Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 21
  • 22. Variations in μ Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 22
  • 23. Variations in σ Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 23
  • 24. 2D Gaussian Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 24
  • 25. Comparison of two 2D Gaussians Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 25
  • 26. 2D Gaussian with σx ≠ σy Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 26
  • 27. 3D Gaussian Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 27
  • 28. Gaussian Mixture Model (GMM) Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 28 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 29. GMM Model Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 29 The number of classes is known Each class has a particular mean and variance Each class has a mixing (or membership) weight. All mixing weights add up to one
  • 30. Toy Problem Parameters Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 30
  • 31. Generating the Toy Problem’s DataSet Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 31 20% 40% Start 40%
  • 32. The GMM Problem Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 32 ??% ??% Start ??%
  • 33. Bayes’ Rule and the Expectation Step Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 33 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 34. Bayes’ Rule Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 34 The likelihood of A given B A prior probability on B The likelihood of B given A A normalization constant
  • 35. The Main of Idea of GMMs: E-Step Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 35 The probability of position j havinga pixel with values x given class i. Basically, evaluate a Gaussian at xusing μi and Σi as parameters The probability that position j is generatedby class 1 or 2: foreground or background The prior probability ofclass i; i.e. the mixing weights Essentially, a normalization constantto ensure that P(C=1|xj) +P(C=2|xj) = 1for j fixed.
  • 36. Update Rules and the Maximization Step Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 36 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 37. Update Rules: M-Step Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 37 In words, define what each ofthese mathematical statementsmean. What do you think is the intuitionbehind these three update rules?
  • 38. Solving a Toy Problem Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 38 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 39. Toy Problem Visually Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 39
  • 40. Typical Output Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 40 Class 2 Class 3 Class 1
  • 41. Solution to the Toy Problem Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 41
  • 42. Comparison of Statistics Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 42
  • 43. Recovery of the Model Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 43
  • 44. 3D GMM Problem Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 44
  • 45. Segmentation using a GMM and Masks Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 45 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 46. Segmentation Example Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 46
  • 47. Segmentation Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 47 The upshot of all of this is that the foreground has a parameterization of: The novelty of this result is that we have a complete and numericalcharacterization of the image without knowing beforehand thecolor of the background. These parameters have been learned.
  • 48. Producing the Mask Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 48 A Gaussian computed using themean and variance of the foregroundclass. The mixing weight 0.9695 A Gaussian computed using themean and variance of the backgroundclass. The mixing weight 0.0305 How would we use a Bayesian philosophy to decide ifa pixel represents the foreground or background?
  • 49. Masks Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 49 This mask permits the sphereto show through while excludingthe background. It’s used tosegment the sphere; that is,segment out the foreground. This mask is the logical complementof the first mask. It indicates wherethe background pixels can be found.This mask is used to prepare the newbackground so that it may becombined with the foreground.
  • 50. Using the Masks for the Foreground and Background Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 50
  • 51. Adding the Images Together Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 51
  • 52. Before and After Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 52 Before After
  • 53. Further Work Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 53 Chroma Keying and our Assumptions RBG Color Model Axioms of Probability Gaussian Distributions Gaussian Mixture Model (GMM) Bayes’ Rule and the Expectation Step Update Rules and the Maximization Step Solving a Toy Problem Segmentation using a GMM and Masks Further Work
  • 54. Further Work Allan Caine, http://www.cs.uwaterloo.ca/~adcaine/ 54 Complex foregrounds and backgrounds Tracking objects Speeding up processing Sampling Smoothing the transition from background to foreground to avoid ragged edges Using alternative color spaces such as Hue-Saturation-Value (HSV) for better classification