MODULE 9 ΚΕΦΑΛΑΙΟ 9. Image Analysis II. Ανάλυση Εικόνας ΙΙ



Σχετικά έγγραφα
ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

Areas and Lengths in Polar Coordinates

Section 8.3 Trigonometric Equations

Areas and Lengths in Polar Coordinates

2 Composition. Invertible Mappings

Homework 3 Solutions

derivation of the Laplacian from rectangular to spherical coordinates

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

9.09. # 1. Area inside the oval limaçon r = cos θ. To graph, start with θ = 0 so r = 6. Compute dr

The Simply Typed Lambda Calculus

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

Section 9.2 Polar Equations and Graphs

Partial Differential Equations in Biology The boundary element method. March 26, 2013

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in

Concrete Mathematics Exercises from 30 September 2016

EE512: Error Control Coding

Reminders: linear functions

Example Sheet 3 Solutions

Chapter 6: Systems of Linear Differential. be continuous functions on the interval

Matrices and Determinants

PARTIAL NOTES for 6.1 Trigonometric Identities

k A = [k, k]( )[a 1, a 2 ] = [ka 1,ka 2 ] 4For the division of two intervals of confidence in R +

Approximation of distance between locations on earth given by latitude and longitude

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

Other Test Constructions: Likelihood Ratio & Bayes Tests

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

C.S. 430 Assignment 6, Sample Solutions

ST5224: Advanced Statistical Theory II

Fourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

Numerical Analysis FMN011

Homework 8 Model Solution Section

4.6 Autoregressive Moving Average Model ARMA(1,1)

Math 6 SL Probability Distributions Practice Test Mark Scheme

Problem Set 3: Solutions

Instruction Execution Times

Pg The perimeter is P = 3x The area of a triangle is. where b is the base, h is the height. In our case b = x, then the area is

Math221: HW# 1 solutions

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής

b. Use the parametrization from (a) to compute the area of S a as S a ds. Be sure to substitute for ds!

New bounds for spherical two-distance sets and equiangular lines

Finite Field Problems: Solutions

Section 7.6 Double and Half Angle Formulas

Section 8.2 Graphs of Polar Equations

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.

Second Order Partial Differential Equations

6.3 Forecasting ARMA processes

TMA4115 Matematikk 3

Inverse trigonometric functions & General Solution of Trigonometric Equations

forms This gives Remark 1. How to remember the above formulas: Substituting these into the equation we obtain with

Parametrized Surfaces

Lecture 2. Soundness and completeness of propositional logic

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

Block Ciphers Modes. Ramki Thurimella

CRASH COURSE IN PRECALCULUS

Chapter 6: Systems of Linear Differential. be continuous functions on the interval

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

Απόκριση σε Μοναδιαία Ωστική Δύναμη (Unit Impulse) Απόκριση σε Δυνάμεις Αυθαίρετα Μεταβαλλόμενες με το Χρόνο. Απόστολος Σ.

ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?

10.7 Performance of Second-Order System (Unit Step Response)

Every set of first-order formulas is equivalent to an independent set

CHAPTER 48 APPLICATIONS OF MATRICES AND DETERMINANTS

ΕΙΣΑΓΩΓΗ ΣΤΗ ΣΤΑΤΙΣΤΙΚΗ ΑΝΑΛΥΣΗ

Statistical Inference I Locally most powerful tests

D Alembert s Solution to the Wave Equation

Τελική Εξέταση =1 = 0. a b c. Τµήµα Ηλεκτρολόγων Μηχανικών και Μηχανικών Υπολογιστών. HMY 626 Επεξεργασία Εικόνας

SOLVING CUBICS AND QUARTICS BY RADICALS

Συστήματα Διαχείρισης Βάσεων Δεδομένων

5.4 The Poisson Distribution.

Fractional Colorings and Zykov Products of graphs

Derivations of Useful Trigonometric Identities

6.1. Dirac Equation. Hamiltonian. Dirac Eq.

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1

Μονοβάθμια Συστήματα: Εξίσωση Κίνησης, Διατύπωση του Προβλήματος και Μέθοδοι Επίλυσης. Απόστολος Σ. Παπαγεωργίου

Strain gauge and rosettes

Srednicki Chapter 55

Solutions to Exercise Sheet 5

Solution Series 9. i=1 x i and i=1 x i.

Bounding Nonsplitting Enumeration Degrees

HISTOGRAMS AND PERCENTILES What is the 25 th percentile of a histogram? What is the 50 th percentile for the cigarette histogram?

Γραµµικός Προγραµµατισµός (ΓΠ)

Lecture 15 - Root System Axiomatics

Spherical Coordinates

Μηχανική Μάθηση Hypothesis Testing

2. THEORY OF EQUATIONS. PREVIOUS EAMCET Bits.

( ) 2 and compare to M.

Quadratic Expressions

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω

Second Order RLC Filters

F-TF Sum and Difference angle

Exercises 10. Find a fundamental matrix of the given system of equations. Also find the fundamental matrix Φ(t) satisfying Φ(0) = I. 1.

department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι

CHAPTER 101 FOURIER SERIES FOR PERIODIC FUNCTIONS OF PERIOD

Uniform Convergence of Fourier Series Michael Taylor

Right Rear Door. Let's now finish the door hinge saga with the right rear door

Transcript:

MODULE 9 ΚΕΦΑΛΑΙΟ 9 Image Analysis II Ανάλυση Εικόνας ΙΙ Hough Transform Μετασχηµατισµός Hough B-Splines Πολυγωνικές Προσεγγίσεις Range Finding by Stereo Imaging Εύρεση Κλίµακας από τις Εικόνες Στέρεο The Correspondence Problem Το Πρόβληµα της Συσχέτισης QUICK INDEX 9.1

MODULE 9 INDEX HOUGH TRANSFORM: LINE AND CURVE DETECTION ΜΕΤΑΣΧΗΜΑΤΙΣΜΟΣ HOUGH: ΓΡΑΜΜΩΝ ΚΑΙ ΚΑΜΠΥΛΩΝ BASIC HOUGH TRANSFORM ΒΑΣΙΚΟΣ ΜΕΤΑΣΧΗΜΑΤΙΣΜΟΣ HOUGH HOUGH ACCUMULATOR ΣΥΣΣΟΡΕΥΤΗΣ HOUGH REFINING THE HOUGH TRANSFORM ΙΗΛΥΣΗ ΤΟΥ ΜΕΤΑΣΧΗΜΑΤΙΣΜΟΥ HOUGH B-SPLINES: CURVE REPRESENTATION ΠΟΛΥΓΩΝΙΚΕΣ ΠΡΟΣΙΓΓΙΣΕΙΣ: ΑΝΤΙΠΡΟΣΩΠΕΥΣΗ ΚΑΜΠΥΛΩΝ ADVANTAGES OF B-SPLINES ΠΛΕΟΝΕΚΤΗΜΑΤΑ ΤΩΝ ΠΟΛΥΓΩΝΙΚΩΝ ΠΡΟΣΕΓΓΙΣΕΩΝ THE B-SPLINE POLYNOMIALS ΤΑ ΠΟΛΥΟΝΗΜΑ ΠΟΛΥΓΩΝΙΚΩΝ ΠΡΟΣΕΓΓΙΣΕΩΝ COMPUTING THE B-SPLINE REPRESENTATION ΥΠΟΛΟΓΙΣΜΟΣ ΤΗΣ ΠΑΡΑΣΤΑΣΗΣ ΤΩΝ ΠΟΛΥΓΩΝΙΚΩΝ ΠΡΟΣΕΓΓΙΣΕΩΝ EXAMPLES: CUBIC B-SPLINES ΠΑΡΑ ΕΙΓΜΑΤΑ: ΚΥΒΙΚΕΣ ΠΟΛΥΓΩΝΙΚΕΣ ΠΡΟΣΕΓΓΙΣΕΙΕΣ MANIPULATING B-SPLINES ΧΕΙΡΙΣΜΟΣ ΠΟΛΥΓΩΝΙΚΩΝ ΠΡΟΣΕΓΓΙΣΕΩΝ RANGE FINDING BY STEREO IMAGING ΕΥΡΕΣΗ ΙΑΣΤΗΜΑΤΟΣ ΑΠΟ ΤΗΝ ΕΙΚΟΝΑ ΣΤΕΡΕΟ STEREO CAMERA GEOMETRY AND TRIANGULATION ΓΕΩΜΕΤΡΙΑ ΚΑΜΕΡΑΣ ΣΤΕΡΕΟ ΚΑΙ ΤΡΙΓΩΝΙΣΜΟΣ BINOCULAR CAMERA GEOMETRY ΓΕΩΜΕΤΡΙΑ ΙΟΠΤΡΙΚΗΣ ΚΑΜΕΡΑΣ TRIANGULATION ΤΡΙΓΩΝΙΣΜΟΣ THE CORRESPONDENCE PROBLEM ΤΟ ΠΡΟΒΛΗΜΑ ΣΥΣΧΕΤΙΣΗΣ COMPLEXITY OF CORRESPONDENCE PROBLEM 9.2

ΠΕΡΙΠΛΟΚΗ ΤΟΥ ΠΡΟΒΛΗΜΑΤΟΣ ΑΝΤΑΠΟΚΡΕΙΣΗΣ THE HUMAN EYE-BRAIN ΤΟ ΑΝΘΡΩΠΙΝΟ ΟΠΤΙΚΟ ΣΥΣΤΗΜΑ AN EDGE-BASED STEREO MATCHING ALGORITHM ΕΝΑΣ ΑΛΓΟΡΙΘΜΟΣ ΣΤΕΡΕΟΤΕΡΙΑΞΗΣ ΜΕ ΒΑΣΗ-ΑΚΜΕΣ SINGLE-SCALE MATCHING ALGORITHM ΑΠΛΟΥ ΙΑΣΤΗΜΑΤΟΣ ΑΛΓΟΡΙΘΜΟΣ ΤΕΡΙΑΞΗΣ A MULTI-SCALE ALGORITHM ΠΟΛΛΑΠΟΥ- ΙΑΣΤΗΜΑΤΟΣ ΑΛΓΟΡΙΘΜΟΣ DENSE STEREO MATCHING ALGORITHMS ΑΛΓΟΡΙΘΜΟΣ ΠΥΚΝΗΣ ΣΤΕΡΙΟΤΕΡΙΑΞΗΣ STEREO PHOTOMETRIC CONSTRAINT ΣΤΕΡΕΟ ΦΩΤΟΜΕΤΡΙΚΟΣ ΠΕΡΙΟΡΙΣΜΟΣ DISPARITY SMOOTHNESS CONSTRAINT ΑΝΟΜΟΙΟΣ ΠΕΡΙΟΡΙΣΜΟΣ ΕΞΩΜΑΛΥΝΣΗΣ DENSE STEREO SOLUTION ΛΥΣΗ ΠΥΚΝΟΥ ΣΤΕΡΕΟ ACTIVE, VERGENT, FIXATING STEREO SYSTEMS ΕΝΕΡΓΗ, ΜΕ ΠΕΡΙΘΩΡΙΟ, ΙΟΡΘΩΣΗ ΣΥΣΤΗΜΑΤΩΝ ΣΤΕΡΕΟ FOVEA EXAMPLE ΠΑΡΑ ΕΙΓΜΑ FOVEA QUICK INDEX 9.3

HOUGH TRANSFORM: LINE AND CURVE DETECTION ΜΕΤΑΣΧΗΜΑΤΙΣΜΟΣ HOUGH: ΑΝΥΧΝΕΥΣΗ ΓΡΑΜΜΩΝ ΚΑΙ ΚΑΜΠΥΛΩΝ The Hough Transform is a simple, generalizable tool for finding instances of curves of a specific shape in a binary edge map. Ο µετασχηµατισµός Hough είναι ένα απλό, γενικοποιηµένο εργαλείο για εύρεση παρουσιών καµπύλων ορισµένου σχήµατος σε ένα δυαδικό χάρτη ακµών What it does: (Τι κανει:) edge map "Circle" Hough transform result Advantages: (Πλεονεκτήµατα:) It is highly noise-insensitive - it can "pick" the shapes from among many spurious edges. Any edge detector, even the LoG, gives rise to "pseudo-edges" in practice. Είναι υψηλά µη-ευαίσθητο στο θόρυβο µπορεί να αρπάξει τα σχήµατα µεταξύ πολλών ψευδόακµών. Κάθε ανιχνευτής ακµών, ακόµα και το LoG, δηµιουργεί στην πράξη ψευδό-ακµές It is able to reconstruct "partial" curves containing gaps and breaks to the "ideal" form. Είναι ικανό να αποκαταστήσει µερικώς καµπύλες που περιέχουν κενά και είναι σπασµένες στην ιδανική µορφή It can be generalized to almost any desired shape. 9.4

Μπορεί να γερικοποιηθεί σε σχεδόν κάθε επιθυµητό σχήµα Disadvantage: (Μειονέκτηµα:) It is computation- and memory-intensive. Είναι υπολογιστικά δαπανηρό και δαπανηρό σε µνήµη. Basic Hough Transform Βασικός Μετασχηµατισµός Hough The basic Hough Transform assumes that it is desired to find the locations of curves that Ο βασικός µετασχηµατισµός Hough θεωρεί ότι είναι επιθυµητή η εύρεση της τοποθεσίας καµπύλων οι οποίες - Can be expressed as functions of the image coordinates (i, j) Μπορούν να εκφραστούν σαν συναρτήσεις των συντεταγµένων (i, j) - Have a set (vector) of parameters Έχουν ένα σύνολο (διάνυσµα) από παραµέτρους a = [a 1,..., a n ] T that specify the exact size, shape, and location of the curves. Το οποίο δηλώνει το ακριβής µέγεθος, σχήµα, και τοποθεσία των καµπύλων In other words, curves of the form Με άλλες λέξεις, καµπύλες της µορφής f(i, j; a) = 0 Examples (Παραδειγµατα) 9.5

2-D lines have a slope-intercept form 2- γραµµές έχουν µορφή κλίσης-τοµής f(i, j; a) = j - mi + b = 0 where a = (m, b) = (slope, y-intercept). όπου a = (m, b) = (κλίση, y-τοµή). 2-D circles have the form 2- κύκλοι έχουν την µορφή f(i, j; a) = (i - i 0 ) 2 + (j - j 0 ) 2 - r 2 = 0 where a = (i 0, j 0, r) = (two center coordinates, radius) όπου a = (i 0, j 0, r) = (δυο συντεταγµένες κέντρου, ακτίνα) 9.6

Basic Hough Transform Βασικός Μετασχηµατισµός Hough Input to the Hough Transform: An edge map (or some other approximation of the image contours). Η είσοδος στο µετασχηµατισµό Hough: Ένας χάρτης ακµών (ή κάποιες άλλες προσεγγίσεις των διαδρόµων εικόνας) From this edge map, a record (accumulator) is made of the possible instances of the shape in the image, and their likelihoods, by counting the number of edge points that fall on the shape contour. Από αυτό τον χάρτη ακµών, η σηµειώσει (συσσώρευση) γίνεται από τις πιθανές παρουσίες του σχήµατος στην εικόνα, και την ποιότητα µε την µέτρηση του αριθµού των σηµείων µιας ακµής τα οποία πέφτουν στην διαδροµή της µορφής Example (Παραδειγµα) Straight line / line segment detection Ευθεία γραµµή / ανίχνευση κοµµατιού γραµµής "Blow-up" of an edge map The "most likely" instance of a straight line segment in this region. The line indicated is the "most likely" because there are seven pixels that contribute evidence for its existence. Η γραµµή που φαίνεται είναι η πιο πιθανή επειδή υπάρχουν επτά στίγµατα τα οποία ενισχύουν τα στοιχεία για την ύπαρξη της. 9.7

There are other "less likely" segments (containing 2 or 3 edge pixels). Υπάρχουν άλλα λιγότερο πιθανά κοµµάτια (που περιέχουν 2 ή 3 στίγµατα ακµών) Hough Accumulator (Συσσορευτης Hough) The Hough accumulator A is a matrix that accumulates evidence of instances of the curve of interest via counting. Ο συσσωρευτής Hough Α είναι ένας πίνακας ο οποίος συσσωρεύει στοιχεία ύπαρξης για την ενδιαφέρουσα καµπύλη για την καταµέτρησης The Hough accumulator A is n-dimensional, where n is the number of parameters in a: Ο συσσωρευτής Hough Α είναι n-διαστάσεων, που είναι ο αριθµός των παραµέτρων στο a: a = [a 1,..., a n ] T Each parameter a i, i = 1,..., n can take only a finite number of values N i (the representation is digital). Κάθε παράµετρος a i, i = 1,..., n µπορεί να πάρει µόνο ένα πεπερασµένο αριθµό τιµών N i (η αντιπροσώπευση είναι ψηφιακή) Thus the accumulator A is an Έτσι ο συσσωρευτής Α είναι ένας N 1 x N 2 x N 3 x x N n-1 x N n matrix containing N 1 N 2 N 3 N n-1 N n slots. Πίνακας που περιέχει N 1 N 2 N 3 N n-1 N n θυρίδες The accumulator A becomes very large if: Ο συσσωρευτής Α γίνεται πολύ µεγάλος αν: - Many parameters are used 9.8

Πολλοί παράµετροι χρησιµοποιήθηκαν - Parameters are allowed to take many values Επιτραπεί στις παραµέτρους να παίρνουν πολλές τιµές The accumulator can become much bigger than the image! Ο συσσωρευτής µπορεί να γίνει πολύ πιο µεγάλος από την εικόνα! It is practical to implement the accumulator A as a single vector (concatenated rows): otherwise many matrix entries may always be empty (if they're "impossible"), thus taking valuable space. Είναι πρακτικό να σχεδιάσουµε τον συσσωρευτή Α σαν απλό διάνυσµα (συνδεδεµένες σειρές): αλλιώς πολλές είσοδοι του πίνακα µπορούν πάντα να είναι (αν είναι αδύνατη ), και έτσι θα παίρνουν πολύτιµο χώρο Accumulator Design Σχεδιασµός Συσσωρευτή The design of the Hough accumulator A is critical to keep its dimensions and size manageable. Η σχεδίαση του συσσωρευτεί Hough Α είναι σηµαντική για να κρατήσει τις διαστάσεις και το µέγεθος κατορθωτό The following are general steps to follow to achieve this: Τα ακόλουθα είναι γενικά βήµατα τα οποία πρέπει να ακολουθηθούν για να πετύχουµε αυτό τον σκοπό STEP ONE - Be sure that the curve equations are appropriate. For example, in line detection, the slope-intercept version is actually poor (nearly vertical lines have large slopes). ΒΗΜΑ ΕΝΑ Σιγουρευτείτε ότι οι εξισώσεις της καµπύλης είναι οι κατάλληλες. Για παράδειγµα, στην ανίχνευση γραµµών, η ερµηνεία της κλίσης-τοµής είναι κάπως φτωχή (σχεδόν κατακόρυφες γραµµές έχουν µεγάλες κλίσεις) A better line representation: polar form Μια καλύτερη αναπαράσταση γραµµής: πολική µορφή 9.9

f(i, j; a) = i cos(θ) + j sin(θ) - r = 0 where a = (r, θ) = (distance, angle) όπου a = (r, θ) = (απόσταση, γωνία) r θ STEP TWO - Bound the parameter space. Once has to do a little math here. Only allow parameters for curves that sufficiently intersect the image. ΒΗΜΑ ΥΟ Βαλτέ όρια στο χώρο των παραµέτρων. Κάποιος πρέπει να κάνει λίγα µαθηµατικά εδώ. Επιτρέψτε µόνο παραµέτρους για καµπύλες οι οποίες ικανοποιητικά κόπτουν την εικόνα 9.10

Interesting lines solid Irrelevant lines dashed Interesting circles solid Irrelevant circles dashed What is "allowable" depends on the application - perhaps (for example) the circles Τι είναι επιτρεπτό εξαρτάτε από την εφαρµογή ίσως (για παράδειγµα) οι κύκλοι - Must lie completely inside the image Πρέπει να πέφτουν εξολοκλήρου στην εικόνα - Must be of some minimum and maximum radius Πρέπει να είναι κάποιου ελάχιστου και µέγιστου ακτίνας 9.11

Example (Παράδειγµα) In an N x N image indexed 0 i, j N-1, detect circles of the form Σε µια N x N εικόνα µε έκθετες 0 i, j N-1, ανιχνεύσιµοι κύκλοι της µορφής f(i, j; a) = (i - i 0 ) 2 + (j - j 0 ) 2 - r 2 = 0 having minimum radii 3 (pixels) and maximum radii 10 (pixels), where the circles are contained by the image. Που έχει ελάχιστη ακτίνα 3 (στίγµατα) και µέγιστη ακτίνα 10 (στίγµατα), όπου οι κύκλοι περιέχονται από την εικόνα This could be implemented, for example, in a coin counter on a bus. Αυτό µπορεί να πραγµατοποιηθεί, για παράδειγµα, σε ένα µετρητή κερµάτων σε ένα λεωφορείο Clearly, we have the following bounds: Καθαρά, έχουµε τα ακόλουθα όρια: 3 r 10 and for each r : (και για κάθε r:) r i 0 (N-1) - r r j 0 (N-1) - r or part of some of the circles will extend outside of the image. ή µέρος από κάποιους κύκλους θα επεκταθεί εκτός της εικόνας This is an example where a rectangular accumulator array will lead to unused array entries. Αυτό είναι ένα παράδειγµα όπου ένας ορθογώνιος πίνακας συσσωρευτείς θα οδηγήσει σε µη χρησιµοποιηµένες θυρίδες στον πίνακα 9.12

Example (Παράδειγµα) In an N x N image indexed 0 i, j N-1, detect lines of the form Σε µια N x N εικόνα µε έκθετες 0 i, j N-1, οι ανίχνευση Άκµων της µορφής f(i, j; a) = i cos(θ) + j sin(θ) - r = 0 that intersect the image. (η οποία κόβει την εικόνα) This means that each line must intersect the four sides of the image in two places. Αυτό σηµαίνει ότι κάθε γραµµή πρέπει να κόβει τις τέσσερις πλευρές της εικόνας σε δυο σηµεία This will happen if either the i-intercept or the j-intercept of the line falls in the range 0,..., N-1. Αυτό θα συµβεί αν όταν η i-τοµή ή η j-τοµή της γραµµής που πέφτει στο διάστηµα 0,..., N-1 But (Αλλά) i-intercept = r / cos(θ) j-intercept = r / sin(θ) So we can bound the parameters as follows: Έτσι µπορούµε να περιορίσουµε τις παραµέτρους ως ακολούθως: Either (είτε) or (ή) 0 r / cos(θ) N-1 0 r / sin(θ) N-1. 9.13

STEP THREE - Quantize the accumulator space. Since curves are digitized, the accumulator is a discrete, finite array. ΒΗΜΑ ΤΡΕΙΑ Κβαντοποιούµε τον χώρο του συσσωρευτή. Επίσης οι καµπύλες ωηφιοποιούνται, ο συσσωρευτής είναι ένας διακριτός, πεπερασµένος πίνακας Decisions must be made regarding how "finely-tuned" the detector is to be. Αποφάσεις πρέπει να παρθούν σχετικά µε το πόσο καλά-συντονισµένος θα είναι ο ανιχνευτής For circles, the choice may be easy - let circle centers (i 0, j 0 ) and circle radii be integer values only, for example. Για κύκλους, η επιλογή µπορεί να είναι απλή ας ορίσουµε το κέντρο κύκλου (i 0, j 0 ) και την ακτίνα κύκλου να είναι ακέραιες τιµές µόνο, για παράδειγµα For lines, the selection can be more complex - since digital lines aren't always "straight": Για γραµµές, η επιλογή µπορεί να είναι πιο περίπλοκη επειδή η ψηφιακές γραµµές δεν είναι πάντα ευθείες : 63 45 135 90 0 117 27 153 ETC The parameters should represent digitally realizable curves. Οι παράµετροι πρέπει να αντιπροσωπεύουν ψηφιακά πραγµατοποιήσιµες καµπύλες 9.14

Example (Παράδειγµα) Consider the earlier circle detection example. Θεωρήστε το προηγούµενο παράδειγµα ανίχνευσης κύκλου In an N x N image, detect circles of the form Σε µια N x N εικόνα, ανιχνεύστε κύκλους της µορφής f(i, j; a) = (i - i 0 ) 2 + (j - j 0 ) 2 - r 2 = 0 Radius constraint: 3 r 10 Περιορισµος Ακτινας: 3 r 10 Center constraints: r i 0 (N-1) - r r j 0 (N-1) r Περιορισµός Κέντρου: r i 0 (N-1) - r r j 0 (N-1) r If the radii and circles centers are integers, then Αν η ακτίνα και το κέντρο του κύκλου είναι ακέραιοι, τότε and for each r: (για κάθε r:) r {3,..., 10} r i 0 (N-1) - r r j 0 (N-1) - r The accumulator contains the following number of slots: Ο συσσωρευτείς περιέχει τον ακόλουθο αριθµό θυρίδων: # circle types = 10 Σ r=3 [N - 2r] 2 = 8N 2-208N +1520 8N 2 This is about 8 times the image size! 9.15

Αυτό είναι περίπου 8 φορές το µέγεθος της εικόνας! Circle detection algorithms often assume just a few radii, e.g., in the coin counter example, just a few coin sizes. Οι αλγόριθµοι ανίχνευσης κύκλων συχνά θεωρούν µόνο λίγες ακτίνες, π.χ., στο παράδειγµα του µετρητή κερµάτων, µόνο λίγα µεγέθη κερµάτων. STEP FOUR - (Application) ΒΗΜΑ ΤΕΣΣΕΡΑ (Εφαρµογή) (1) Initialize the accumulator A to 0. Τοποθετούµε τον συσσωρευτεί Α στο 0. (2) At each edge coordinate (i, j ), [E(i, j ) = 1] increment A: Σε κάθε συντεταγµένη ακµής (i, j ), [E(i, j ) = 1] αυξάνουµε το Α: - For all accumulator elements a such that (ε small) Για όλα τα στοιχεία του συσσωρευτεί a στα οποία (µικρό ε) set f(i, j ; a ) ε A(a ) = A(a ) + 1 until all edge points have been examined. µέχρις ότου όλα τα σηµεία της ακµής έχουν ελεγχθεί (3) Threshold the accumulator. Those parameters a such that Κατωφλίωση του συσσωρευτή. Αυτοί οι παράµετροι a στους οποίους A(a ) τ represent instances of the curve being detected. 9.16

Αντιπροσωπεύουν παρουσίες της καµπύλης που έχει ανιχνευτή Since local regions of the accumulator may fall above threshold, detection of local maxima is usually done. Επειδή τα τοπικά σηµεία του συσσωρευτεί µπορούν να πέσουν πάνω από το κατώφλι, η ανίχνευση του τοπικού µέγιστου συνήθως γίνεται Comments on the Hough Transform Σχόλια Πάνω στο Μετασχηµατισµό Hough Substantial memory required even for simple problems, such as line detection. Σηµαντική µνήµη χρειάζεται ακόµα και σε απλά προβλήµατα, όπως ανίχνευση γραµµών Computationally intensive; all accumulator points are examined (potentially incremented) as each image pixel is examined. Υπολογιστικά απανηρές, όλα τα σηµεία του συσσωρευτεί εξετάζονται (δυνητικά αυξάνονται) όταν κάθε στίγµα εικόνας εξετάζετε Refinements of the Hough Transform are able to deal with these problems to some degree. Η ιύλιση του Μετασχηµατισµού Hough είναι ικανή να ασχοληθεί µε αυτά τα προβλήµατα σε κάποιο βαθµό 9.17

Refining the Hough Transform ιύλιση του Μετασχηµατισµού Hough The best way to reduce both computation and memory requirement is to reduce the size of the Hough array. Here is a (very) general modified approach that proceeds in stages: Ο καλύτερος τρόπος για µείωση των υπολογιστικών και αποθηκευτικών απαιτήσεων είναι να µειώσουµε το µέγεθος του πίνακα Hough. Εδώ είναι µια (πολύ) γενική αλλαγµένη προσέγγιση η οποία προχωρεί σε σταδία: (0) Coarsely quantize the Hough accumulator array. Define an error threshold ε0 and two variable thresholds τi and εi. Κοινα κβαντοποιούµε τον πινακα του συσσορευτη Hough. Ορίζουµε ένα κατώφλι λάθους ε0 και δυο µεταβλητά κατώφλια τi και εi. (1) Increment the Hough array wherever Αυξάνουµε τον πίνακα Hough οπουδήποτε f(i, j ; a ) εm where (όπου) εm > ε0. (2) Threshold the Hough array using a threshold τm. Κατωφλιώνουµε τον πίνακα Hough χρησιµοποιώντας το κατώφλι τm. (3) Redefine the Hough array by Ξανά-ορίζουµε τον πίνακα Hough µε - Only allowing values similar to those τm Μόνο επιτρεπόµενες τιµές παρόµοιες µε αυτές τm - Re-quantize the Hough array more finely over these values Ξανά-κβαντοποιούµε τον πίνακα Hough πιο ακριβές πάνω σε αυτές τις τιµές (4) Unless εm < ε0, set εm+1 < ε m, τm+1 < τ m and go to (1) 9.18

Αν δεν εm < ε0, θέτουµε εm+1 < ε m, τm+1 < τ m και παµε πίσω στο (1) The exact approach taken in such a strategy will vary with the application and available resources, but generally: Η ακριβής προσέγγιση που πάρθηκε σε µια τέτοια στρατηγική θα αλλάζει την εφαρµογή και τις διαθέσιµες πήγες, αλλά γενικά: - The Hough array can be made much smaller (hence faster) Ο πίνακας Hough µπορεί να γίνει πολύ πιο µικρός (και έτσι γρηγορότερος) - Eventually a similar result will be attained Σταδιακά ένα παρόµοιο αποτέλεσµα θα επιτευχθεί B-SPLINES: CURVE REPRESENTATION ΠΟΛΥΓΩΝΙΚΕΣ ΠΡΟΣΕΓΓΙΣΕΙΣ: ΑΝΤΙΠΡΟΣΩΠΕΥΣΗ ΚΑΜΠΥΛΩΝ The Hough Transform is a method for finding curves having a certain parametric representation. Ο Μετασχηµατισµός Hough είναι µια µέθοδος για εύρεση καµπυλών που έχουν κάποια συγκεκριµένη παραµετρική αντιπροσώπευση Once each curve is found, the exact location, shape, and size of its representation is known. Όταν κάθε καµπύλη βρεθεί, η ακριβής τοποθεσία, σχήµα, και µέγεθος της αντιπροσώπευσης της είναι γνωστή Thus the Hough Transform admits an efficient representation of the objects found. Έτσι ο µετασχηµατιστής Hough παραδέχεται µια αποτελεσµατική αντιπροσώπευση των αντικειµένων που βρέθηκαν Often it is not possible to know the type of curve to be found - the objects in the scene may have very general shapes. Συχνά δεν είναι πιθανόν να ξέρουµε τον τύπο των καµπυλών που θα βρεθούν τα αντικείµενα στην σκηνή µπορεί να έχουν πολύ γενικές µορφές B-Splines (Basis splines) are a very general, practical method for representing curves in images. 9.19

Οι πολυγωνικές προσεγγίσεις είναι µια πολύ γενική, πρακτική µέθοδος για την αντιπροσώπευση καµπύλων στην εικόνα B-splines are approximating polynomials that are fitted to the curves of interest. Οι πολυγωνικές προσεγγίσεις προσεγγίζουν πολυνοµία τα οποία ταιριαζάνται στις ενδιαφερόµενες καµπύλες The input is generally an edge map or other binary contour image. Η είσοδος είναι γενικά ένας χάρτης Άκµων ή άλλη εικόνα δυαδικής διαδροµής Advantages of B-Splines Πλεονεκτήµατα των Πολυγωνικών Προσεγγίσεων Aesthetically pleasing - a smooth, continuous representation. Αισθητική ευχαρίστηση µια εξοµαλυσµένη, συνεχής αντιπροσώπευσης The human eye cannot perceive curve discontinuities higher than second order (discontinuities in the curve derivative). Smooth representations (in this sense) are sufficient for perception. Το ανθρώπινο µάτι δεν µπορεί να αισθανθεί ασυνέχειες καµπύλων µεγαλύτερων του δευτέρου βαθµού (ασυνέχειες στην παραγωγό της καµπύλης). Εξοµαλυσµένες αντιπροσωπεύσεις (µε αυτή την έννοια) είναι ικανοποιητικές για την αντίληψη µας Simple low-order polynomials are good representation primitives. Απλά Χαµηλού-Βαθµού πολυνοµία είναι καλές αρχικές αντιπροσωπεύσεις B-splines are highly compact - a curve can be represented by the polynomial coefficients. Οι πολυγωνικές προσεγγίσεις είναι υψηλά συµπιεσµένες µια καµπύλη µπορεί να αντιπροσωπευθεί από τους συντελεστές ενός πολυώνυµου B-splines are not suitable for all contours. Very rough contours, such as the outline of a mountain or continent, may be better represented by a rough representation such as a fractal. 9.20

Οι πολυγωνικές προσεγγίσεις δεν είναι κατάλληλες για όλες τις διαδροµές. Πολύ τραχύς διάδροµος όπως το περίγραµµα ενός βουνού ή ηπείρου, µπορεί να αντιπροσωπευθεί καλύτερα από µια τραχιά αντιπροσώπευση όπως το fractal However, a spline can always be used as a gross representation (with which a rougher, more detailed representation may be associated). Ωστόσο, οι πολυγωνικές προσεγγίσεις µπορεί πάντα να χρησιµοποιηθούν σαν µια κύρια αντιπροσώπευση (µε την οποία µια πιο τραχύς, µε περισσότερη λεπτοµέρεια αντιπροσώπευση µπορεί να σχετιστεί) Definitions and Steps Involved Ορισµοί των βηµάτων που λαµβάνουν µέρος B-splines are piecewise polynomial functions used to locally approximate curves. Οι πολυγωνικές προσεγγίσεις είναι πολυνοµία συναρτήσεων σηµείου που χρησιµοποιούνται για να προσεγγίσουν τοπικά τις καµπύλες Definitions: (Ορισµοί:) (iq, jq) = coordinates of input points to be fit via B-spline (0 q Q-1) (iq, jq) = συντεταγµένες από σηµεία εισόδου για να ταιριάξουν διαµέσου των πολυγωνικών προσεγγίσεων rm = (rm, sm), 0 m M-1 << Q-1 = control points = a subset of the input points (iq, jq) = σηµεία έλεγχου = ένα υποσύνολο των σηµείων εισόδου (iq, jq) t = curve parameter (παράµεροι καµπυλών) x(t) = [x(t), y(t)] T = coordinates of the B-spline representation = συντεταγµένες αντιπροσώπευσης πολυγωνικών προσεγγίσεων 9.21

Bk(t) = normalized B-spline of order k = παίρνουµε την κανονικότητα πολυγωνικών προσεγγίσεων του βαθµού k We will now address the following points: Θα αναφέρουµε τώρα τα ακόλουθα σηµεία: (1) Finding the input coordinates (iq, jq) Εύρεση των συντεταγµένων εισόδου (iq, jq) (2) Selecting a set of control points Επιλογή συνόλου σηµείων έλεγχου (3) Parametrized curves Παραµετρικές Καµπύλες (4) The B-spline polynomials Τα πολυνοµία των πολυγωνικών προσεγγίσεων (5) Computing the B-spline representation Υπολογισµός αντιπροσώπευσης πολυγωνικών προσεγγίσεων (6) Examples: cubic B-splines Παράδειγµα: κυβικές πολυγωνικές προσεγγίσεις 9.22

(1) Finding the Input Coordinates (iq, jq) Εύρεση των Συντεταγµένων Εισόδου (iq, jq) The input coordinates (iq, jq) to a B-spline generator are a set of endpoint-to-endpoint contour coordinates Οι συντεταγµένες εισόδου (iq, jq) σε µια γεννήτρια πολυγωνικής προσέγγισης είναι ένα σύνολο από τελικού σηµείου-προς-σηµείου συντεταγµένων διαδρόµων (i0, j0),..., (iq-1, jq-1) that are taken from a binary edge map or other contour map. οι οποίες πάρθηκαν από ένα διάδικο χάρτη Άκµων ή κάποιον άλλο χάρτη διαδρόµων The output of a LoG edge detector is an ideal set of contours since the edge points are connected and of single-pixel width: Η έξοδος του LoG ανιχνευτή ακµών είναι ένα ιδανικό σύνολο από διαδροµές αφού τα σηµεία ακµών είναι συνδεδεµένα και έχουν πάχος απλού-στίγµατος LoG Edge Map The edge map must be parsed prior to attempting the B-spline fit. The goals of parsing are to Ο χάρτης ακµών πρέπει να αναλυθεί πριν την προσπάθεια της ταίριαξης πολυγωνικής προσέγγισης. Οι σκοποί της ανάλυσης είναι να 9.23

(A) (B) Identify the separate curves in the image Αναγνωρίσουν τις καθορισµένες καµπύλες στην εικόνα Identify curves of sufficient length (optional) Αναγνωρίσουν τις καµπύλες µε ικανοποιητικό µήκος (µε αναγκαίο) (1A) Curve Identification Αναγνώριση Καµπυλών A process of creating a set of coordinates for each contour. Η διαδικασία της δηµιουργίας ενός συνόλου συντεταγµένων για κάθε διαδροµή First find a set of end-points then for each end-point find the connected curve of which it is a part. Πρώτα βρέστε ένα σύνολο από τελικά-σηµεία, µετά για κάθε τελικό σηµείο βρέστε την συνδεδεµένη καµπύλη της οποίας είναι µέρος The following pseudo-code explains the process concisely, where E = [E(i, j)] is an edge map, and CONT is a matrix containing: Ο ακόλουθος ψευδό-κώδικας εξηγεί την διαδικασία συνοπτικά, όπου E = [E(i, j)] είναι ένας χάρτης ακµών, και CONT είναι ένας πίνακας που περιέχει: P rows (P > # expected contours) 2Q columns (Q > # expected points in a contour) CONT contains the edge contour coordinates in pairs (p, q). Το CONT περιλαµβάνει συντεταγµένες διαδρόµων ακµής σε ζεύγη (p, q). The process proceeds in two stages: Η διαδικασία προχωρεί µε δυο τρόπους: - record open curves bounded by two endpoints καταγράφουµε τις ανοικτές καµπύλες που περιέχονται µεταξύ δυο τελικών σηµείων - record closed curves with no endpoints καταγράφουµε τις κλειστές καµπύλες χωρίς τελικά σηµεία 9.24

open curves closed curves Pseudo-Code for Tracing Open Contours Ψευδό-Κώδικας για ιχνηλατήσει ανοικτών διαδρόµων int E [N ] [N], CONT [P ] [2*Q], p, q, m0, n0, m1, n1, P; int NUMPTS [P]; While scanning the image left-to-right and top-to-bottom do Ενώ σαρώνουµε την εικόνα από αριστερά-προς-δεξιά και από πάνω-προς-τα κάτω κάνουµε (p, q) = (0, 0); NUMCONT = 0; if E(m, n) = 1 and (m, n) CONT { (m1, n1) = (m, n) look: if (m0, n0) is the only 8-neighbor of (m1, n1) such that E(m0, n0) = 1 and (m0, n0) CONT { CONT(p, q) = m0; (record row coordinate) q = q+1; CONT(p, q) = n0; (record column coordinate) q = q+1; m1 = m0; (examine neighbors of new point) n1 = n0; goto look; } 9.25

} NUMPTS (p) = q / 2; p = p+1; q = 0; P = p; (increment contour count) (reinitialize coordinate count) (total # of contours) Pseudo-Code for Tracing Closed Contours: Ψευδό-Κώδικας για Ιχνηλάτηση Κλειστών ιαδρόµων: Identical code except that the boldface "only" is replaced by "an". Ταυτίσιµος κώδικας εκτός του ότι το µαυρισµένο µόνο αντικαθιστάτε µε ένα This will select the first point in a contour as an "end-point." Αυτό θα επιλέξει το πρώτο σηµείο στην διαδροµή σαν ένα τελικό σηµείο Result of Contour Tracing Αποτέλεσµα της ιχνηλάτησης διαδρόµων A count P of the number of contours found. Ένας µετρητής Ρ του αριθµού των διαδρόµων που βρέθηκαν For the pth contour a count NUMPTS(p) of the number of coordinate pairs in the contour. Για την pth διαδροµή ένας µετρητής NUMPTS(p) του αριθµού των ζευγών συντεταγµένων στην διαδροµή For each p a vector CONT(p, q) containing the contour coordinates in pairs: Για κάθε p ένα διάνυσµα CONT(p, q) περιέχει τις συντεταγµένες της διαδροµής σε ζεύγη: qth coordinate pair = [CONT(p, 2q), CONT(p, 2q+1)] Observe that contour crossings are handled by these algorithms: Παρατηρήστε ότι η διασταύρωση διαδρόµων στηρίζονται ένταξη από αυτούς τους αλγόριθµους Pixel being examined and prior contour points There is no way of knowing "which direction" should be taken - the choice is arbitrary. εν υπάρχει τρόπος για γνωστοποίηση ποια διεύθυνση πρέπει να παρθεί η επιλογή είναι τυχαία 9.26

(1B) Identify Curves of Sufficient Length Αναγνώριση Καµπυλών Ικανοποιητικού Μήκους Often it is of interest to represent only those contours of sufficient length. Smaller contours may be a product of noise, etc. Συχνά είναι ενδιαφέρον να αντιπροσωπεύσουµε µόνο τις διαδροµές ικανοποιητικού µήκους. Οι µικρές διαδροµές µπορεί να είναι αποτέλεσµα θορύβου, κλπ. If PMIN is the minimum contour length to be allowed, we can do the following to remove the short contours: Αν το PMIN είναι το ελάχιστο µήκος διαδρόµων που θα επιτραπεί, µπορούµε να κάνουµε τα ακόλουθα για να αφαιρέσουµε τις µικρές διαδροµές int CONT [P ] [2*Q], NUMPTS [P], p, q, P, PMIN; int q0, NEWP NEWP = P; do { if NUMPTS(p) PMIN { do (replace row by next row) { CONT(p, q0) = CONT(p+1, q0); } while (0 q0 2*NUMPTS(p+1)); NUMPTS(p) = NUMPTS(p+1); NEWP = P-1; } } while (0 p NEWP); 9.27

Result of Contour Elimination Αποτέλεσµα του Περιορισµού ιαδρόµων Once the previous algorithm finishes, the array CONT will contain only those contours of sufficient length PMIN: Όταν ο προηγούµενος αλγόριθµος τελειώσει, ο πίνακας CONT θα περιέχει µόνο αυτές τις διαδροµές ικανοποιητικού µήκους PMIN: qth coordinate pair = [CONT(p, 2q), CONT(p, 2q+1)] A count NEWP of the number of "long" contours found. Ένας µετρητής NEWP του αριθµού των µικρών διαδρόµων που βρέθηκαν A count NUMPTS (p) of the number of coordinate pairs in the pth contour. Ένας µετρητής NUMPTS (p) του αριθµού ζευγών συντεταγµένων στη pth διαδροµή The endpoints of the pth contour are Τα τελικά σηµεία της pth διαδροµής είναι start coordinates = [CONT(p, 0), CONT(p, 1)] αρχικές συντεταγµένες end coordinates = [CONT(p, imax), CONT(p, jmax)] τελικές συντεταγµένες where (οπου) imax = 2 * NUMPTS(p) jmax = 2 * NUMPTS(p) + 1 Contour map Revised contour map 9.28

This is really just a version of blob coloring (Module 2). Αυτό είναι πραγµατικά απλός µια ερµηνεία του χρωµατισµού µερών (Κεφαλαίο 2) (2) (3) Selecting a Set of Control Points Επιλογή Συνόλου µε Σηµεία Έλεγχου It is not necessary to fit a B-spline to all of the points on a contour. εν είναι απαραίτητο να ταιριάξουµε µια πολυγωνική προσέγγιση σε όλα τα σηµεία σε µια διαδροµή In fact is it desirable to use a small subset of the contour points, called control points - in this way, the B-spline becomes efficient. Είναι γεγονός ότι είναι επιθυµητή η χρήση µικρών υποσυνόλων των σηµείων της διαδροµής, που καλούνται σηµεία έλεγχου µε αυτό τον τρόπο, η πολυγωνική προσέγγιση γίνεται ικανοποιητική The goal of control point selection is to select a set of points that will allow the most faithful B- spline representation. Ο σκοπός της επιλογής σηµείου έλεγχου είναι να επιλέξουµε ένα σύνολο σηµείων το οποίο θα επιτρέπει την πιο πιστή αντιπροσώπευση της πολυγωνικής προσέγγισης In particular, high-curvature segments of the contour should be represented more densely than lowcurvature segments. Συγκεκριµένα, υψηλής-καµπυλότητας κοµµάτια της διαδροµής θα αντιπροσωπεύονται πιο πυκνά από κοµµάτια χαµηλής-καµπυλότητας Polyline Approximation Πολύγραµµη Προσέγγιση Polyline approximation is useful for selecting a set of control points Η πολύγραµµη προσέγγιση είναι χρήσιµοι για την επιλογή ενός συνόλου από σηµεία έλεγχου rm = (rm, sm) ; 0 m M-1 << Q-1 that are a subset of the input points τα οποία είναι υποσύνολα των σηµείων εισόδου (iq, jq) ; 0 q Q-1 defining a particular contour. ορίζουµε µια ιδιαίτερη διαδροµή 9.29

In the following assume a single contour since they have already been parsed and can be processed separately. Ακολούθως θεωρούµαι µια απλή διαδροµή αφού έχουν ήδη αναλυθεί και µπορούν να επεξεργαστούν ξεχωριστά Polyline Approximation Algorithm Αλγόριθµος Πολυγραµµικής Προσέγγισης (Για µια καµπύλη µήκους Q:) For a curve of length Q: {(i0, j0),..., (iq-1, jq-1)} (pairs in CONT) (Αντιπροσωπεύονται από Μ σηµεία έλεγχου:) To be represented by M control pts: {(r0, s0),..., (rm-1, sm-1)}. (1) Set r0 = (r0, s0) = (i0, j0) r1 = (r1, s1) = (iq-1, jq-1) (2) For each pair of consecutive control points: Για κάθε ζεύγος από διαδοχικά σηµεία έλεγχου: rm = (rm, sm) and rm+1 = (rm+1, sm+1) do (2a) Find the line between rm and rm+1. It is given by: Βρέστε την γραµµή µεταξύ rm και rm+1. ίνετε από A i + B j + C = 0 Where (όπου) A = (sm+1 - sm), B = (rm - sm+1), C = (rm+1 sm+1 - rm sm+1) (2b) For each point (it, jt) lying on the contour between rm and rm+1, compute its distance to the line. It is: Για κάθε σηµείο (it, jt) που πέφτει πάνω στη διαδροµή µεταξύ rm και rm+1, υπολογίστε την απόσταση στην γραµµή. Είναι: (3) Suppose the most distant point (from any line) lies between rn and rn+1. Then distance = Ai t +B j t +C/ A 2 +B 2 9.30