Timing with Optimization

Slides:



Advertisements
Similar presentations
Union-Find structure Mikko Malinen School of Computing University of Eastern Finland.
Advertisements

CSE 373 Optional Section Union Find, Homework & A. Conrad Nied.
Clustering & image segmentation Goal::Identify groups of pixels that go together Segmentation.
Lecture 07 Segmentation Lecture 07 Segmentation Mata kuliah: T Computer Vision Tahun: 2010.
EECS 311: Chapter 8 Notes Chris Riesbeck EECS Northwestern.
Chapter 8: The Disjoint Set Class Equivalence Classes Disjoint Set ADT CS 340 Page 132 Kruskal’s Algorithm Disjoint Set Implementation.
Union-Find: A Data Structure for Disjoint Set Operations
Lecture 6 Image Segmentation
CSE 326: Data Structures Disjoint Union/Find Ben Lerner Summer 2007.
Disjoint Union / Find CSE 373 Data Structures Lecture 17.
CSE 326: Data Structures Disjoint Union/Find. Equivalence Relations Relation R : For every pair of elements (a, b) in a set S, a R b is either true or.
Union-Find Problem Given a set {1, 2, …, n} of n elements. Initially each element is in a different set. {1}, {2}, …, {n} An intermixed sequence of union.
CS 376b Introduction to Computer Vision 04 / 04 / 2008 Instructor: Michael Eckmann.
Course: Data Structures Lecturer: Uri Zwick March 2008
Binary Image Analysis. YOU HAVE TO READ THE BOOK! reminder.
Course: Data Structures Lecturers: Haim Kaplan and Uri Zwick June 2010
CS 473Lecture X1 CS473-Algorithms I Lecture X Ackermann’s Function and Its Inverse.
G52IIP, School of Computer Science, University of Nottingham 1 Edge Detection and Image Segmentation.
CS 6825: Binary Image Processing – binary blob metrics
CSE373: Data Structures & Algorithms Lecture 11: Implementing Union-Find Aaron Bauer Winter 2014.
CMSC 341 Disjoint Sets. 8/3/2007 UMBC CMSC 341 DisjointSets 2 Disjoint Set Definition Suppose we have an application involving N distinct items. We will.
CMSC 341 Disjoint Sets Textbook Chapter 8. Equivalence Relations A relation R is defined on a set S if for every pair of elements (a, b) with a,b  S,
CSE373: Data Structures & Algorithms Lecture 10: Implementing Union-Find Dan Grossman Fall 2013.
Fundamental Data Structures and Algorithms Peter Lee April 24, 2003 Union-Find.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Disjoint Sets.
The Disjoint Set Class Data Structures & Problem Solving Using JAVA Second Edition Mark Allen Weiss Chapter 24 © 2002 Addison Wesley.
0 Union-Find data structure. 1 Disjoint set ADT (also Dynamic Equivalence) The universe consists of n elements, named 1, 2, …, n n The ADT is a collection.
CMSC 341 Disjoint Sets. 2 Disjoint Set Definition Suppose we have N distinct items. We want to partition the items into a collection of sets such that:
Nottingham Image Analysis School, 23 – 25 June NITS Image Segmentation Guoping Qiu School of Computer Science, University of Nottingham
November 5, 2013Computer Vision Lecture 15: Region Detection 1 Basic Steps for Filtering in the Frequency Domain.
CSE 373 Optional Section Disjoint Sets & Homework 4 February 13, 2014 Nicholas Shahan & A. Conrad Nied.
Image Segmentation Nitin Rane. Image Segmentation Introduction Thresholding Region Splitting Region Labeling Statistical Region Description Application.
Color Image Segmentation Mentor : Dr. Rajeev Srivastava Students: Achit Kumar Ojha Aseem Kumar Akshay Tyagi.
Machine Vision ENT 273 Lecture 4 Hema C.R.
Graphcut Textures:Image and Video Synthesis Using Graph Cuts
Computer Vision Lecture 13: Image Segmentation III
Lecture No.43 Data Structures Dr. Sohail Aslam.
Disjoint Sets Chapter 8.
Review for Final Exam Non-cumulative, covers material since exam 2
Review for Final Exam Non-cumulative, covers material since exam 2
Course Outline Introduction and Algorithm Analysis (Ch. 2)
CMSC 341 Disjoint Sets Based on slides from previous iterations of this course.
Disjoint Set Neil Tang 02/23/2010
Disjoint Set Neil Tang 02/26/2008
Inserting a table into word
CS200: Algorithm Analysis
CSE 332: Data Structures Disjoint Set Union/Find
Lecture 31: Graph-Based Image Segmentation
Hannah Tang and Brian Tjaden Summer Quarter 2002
Course: Data Structures Lecturer: Uri Zwick March 2008
Algorithms Lecture #37 Dr. Sohail Aslam.
CSE373: Data Structures & Algorithms Implementing Union-Find
Union-Find.
Algorithms Lecture # 29 Dr. Sohail Aslam.
CMSC 341 Disjoint Sets.
Disjoint Sets DS.S.1 Chapter 8 Overview Dynamic Equivalence Classes
CMSC 341 Disjoint Sets.
Running Time Analysis Union is clearly a constant time operation.
Algorithms Lecture # 27 Dr. Sohail Aslam.
Dynamic Equivalence Problem
Algorithms Lecture # 01 Dr. Sohail Aslam.
Algorithms Lecture # 02 Dr. Sohail Aslam.
Disjoint Sets Textbook Chapter 8
Algorithms Lecture #42 Dr. Sohail Aslam.
Algorithms Lecture # 26 Dr. Sohail Aslam.
Algorithms Lecture # 25 Dr. Sohail Aslam.
Using simple machine learning for image segmentation
Disjoint Set Operations: “UNION-FIND” Method
Presentation transcript:

Timing with Optimization Theorem: A sequence of m union and find operations, n of which are find operations, can be performed on a disjoint-set forest with union by rank (weight or height) and path compression in worst case time proportional to (m (n)). (n) is the inverse Ackermann’s function which grows extremely slowly. For all practical puposes, (n)  4. Union-find is essentially proportional to m for a sequence of m operations, linear in m. End of lecture 36

Lecture No.37 Data Structures Dr. Sohail Aslam

Inclusion criteria for pixels Image Segmentation Inclusion criteria for pixels use pixel intensity, threshold of intensity, threshold for difference in intensity of neighbors, texture (ie. a pattern of pixel intensities) Start lecture 37 here.

Image Segmentation 0 1 2 3 4 0 0 0 0 4 4 1 2 0 4 4 0 2 4 2 2 4 4 3 4 4 0 4 4 4 0 2 2 4 0

Image Segmentation 0 1 2 3 4 0 0 0 0 4 4 1 2 0 4 4 0 2 4 2 2 4 4 3 4 4 0 4 4 4 0 2 2 4 0 0 1 2 3 4 0 0 0 0 1 1 1 0 0 1 1 0 2 1 0 0 1 1 3 1 1 0 1 1 4 0 0 0 1 0 Threshold=4

Image Segmentation 0 1 2 3 4 0 0 0 0 4 4 1 2 0 4 4 0 2 4 2 2 4 4 3 4 4 0 4 4 4 0 2 2 4 0 0 1 2 3 4 0 0 0 0 1 1 1 1 0 1 1 0 2 1 1 1 1 1 3 1 1 0 1 1 4 0 1 1 1 0 Threshold=2

Maze Generation

Maze Generation A random maze generator can use union-find. Consider a 5x5 maze: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Maze Generator Initially, 25 cells, each isolated by walls from the others. This corresponds to an equivalence relation -- two cells are equivalent if they can be reached from each other (walls been removed so there is a path from one to the other).

Maze Generator IN OUT To start, choose an entrance and an exit.   1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 OUT 20 21 22 23 24 

Maze Generator Randomly remove walls until the entrance and exit cells are in the same set. Removing a wall is the same as doing a union operation. Do not remove a randomly chosen wall if the cells it separates are already in the same set.

MakeMaze MakeMaze(int size) { entrance = 0; exit = size-1; while (find(entrance) != find(exit)) { cell1 = randomly chosen cell cell2 = randomly chosen adjacent cell if (find(cell1) != find(cell2) { knock down wall between cells union(cell1, cell2) }

Maze Generator Cell 11, right wall chosen randomly   IN 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  OUT

Maze Generator Cell 11, right wall chosen randomly   IN 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 S_11 = { 11,12} 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  OUT

Maze Generator Cell 6, bottom wall chosen randomly   IN 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 S_11 = { 11,12} 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  OUT

Maze Generator Cell 6, bottom wall chosen randomly   IN 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 S_11 = { 11,12, 6} 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  OUT

Maze Generator Cell 8, top wall chosen randomly   IN 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9 S_11 = { 11,12, 6} 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  OUT

Maze Generator Cell 8, top wall chosen randomly   IN 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9 S_11 = { 11,12, 6} 10 11 12 13 14 S_8 = { 8,3} 15 16 17 18 19 20 21 22 23 24  OUT

Maze Generator Cell 14, top wall chosen randomly   IN 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 9 S_11 = { 11,12, 6} 10 11 12 13 14 S_8 = { 8,3} 15 16 17 18 19 20 21 22 23 24  OUT

Maze Generator Cell 14, top wall chosen randomly   IN 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 9 S_11 = { 11,12, 6} 10 11 12 13 14 S_8 = { 8,3} S_14 = { 14,9} 15 16 17 18 19 20 21 22 23 24  OUT

Maze Generator Cell 0, bottom wall chosen randomly   IN 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 S_11 = { 11,12, 6} 10 11 12 13 14 S_8 = { 8,3} S_14 = { 14,9} 15 16 17 18 19 20 21 22 23 24  OUT

Maze Generator Cell 0, bottom wall chosen randomly   IN 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 S_11 = { 11,12, 6} 10 11 12 13 14 S_8 = { 8,3} End of lecture 37. S_14 = { 14,9} 15 16 17 18 19 S_0 = { 0,5} 20 21 22 23 24  OUT