1. Trang chủ
  2. » Thể loại khác

Arithmetic Sequences

24 168 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 24
Dung lượng 893,09 KB

Nội dung

Xử lý ảnh Lê Xuân Bách-Phạm Kiên Giang-Nguyễn Đình Nam-Đồng Thị Tâm Trường đại học Bách Khoa Hà Nội Viện công nghệ thông tin và truyền thông Bộ môn kĩ thuật máy tính Bài tập lớn môn xử lý ảnh: Extract face sequences from video Nhóm thực hiện:  Lê Xuân Bách Kĩ thuật máy tính K52  Phạm Kiên Giang Kĩ thuật máy tính K52  Nguyễn Đình Nam Kĩ thuật máy tính K52  Đồng Thị Tâm Kĩ thuật máy tính K52 Giáo viên hướng dẫn : Gv. Hoàng Văn Hiệp. 1 Xử lý ảnh Lê Xuân Bách-Phạm Kiên Giang-Nguyễn Đình Nam-Đồng Thị Tâm Mục lục 1. Giới thiệu về OpenCV OpenCV là mã nguồn mở của Intel, nó là một thư viện có khả năng nhúng vào trong các chương trình có khả năng nhận diện hình ảnh của máy tính .Nó bao gồm khả năng tiên tiến như phát hiện khuôn mặt, theo dõi khuôn mặt, nhận diện khuôn mặt… Ngoài ra, nó cung cấp rất nhiều các thuật toán xử lý ảnh thông qua các hàm API. 1.1. Tổng quan OpenCV Intel phát hành phiên bản đầu tiên của OpenCV vào năm 1999. Ban đầu, nó yêu cầu như là thư viện xử lý hình ảnh của Intel. Nhưng các vấn đề phụ thuộc đã được gỡ bỏ và bây giờ bạn có thể sử dụng OpenCV là một thư viện độc lập. OpenCV hỗ trợ đa nền tảng. Nó hỗ trợ cả Windows và Linux, và gần đây hơn là MacOSX. Với giao diện của nó là nền tảng độc lập. 2 Xử lý ảnh Lê Xuân Bách-Phạm Kiên Giang-Nguyễn Đình Nam-Đồng Thị Tâm Hình 1. Các khả năng của OpenCV có thể là nhận diện khuôn mặt (trên cùng bên trái), phát hiện đường đồng mức (trên bên phải), và phát hiện cạnh (phía dưới) 1.1.1. Các tính năng Dưới đây là một bản tóm tắt của các loại chức năng quan trọng trong OpenCV, phiên bản 1.0: • General computer-vision and image-processing algorithms (mid- and low-level APIs). Sử dụng các interface này, bạn có thể thử nghiệm nhiều tiêu chuẩn thuật toán tầm nhìn máy tính mà không cần phải code chúng. Bao gồm các việc như : phát hiện cạnh, đường, và phát hiện góc, hình elip, kim tự tháp ….và nhiều hơn nữa . • High-level computer-vision modules OpenCV bao gồm một số khả năng cao cấp. Ngoài việc phát hiện khuôn mặt, nhận diện, và theo dõi, nó còn bao gồm dòng chảy quang học (bằng cách sử dụng máy ảnh chuyển động để xác định cấu trúc 3D), hiệu chuẩn máy ảnh. 3 Xử lý ảnh Lê Xuân Bách-Phạm Kiên Giang-Nguyễn Đình Nam-Đồng Thị Tâm • AI and machine-learning methods. Ứng dụng tầm nhìn máy tính thường đòi hỏi máy học hoặc sử dụng phương thức AI khác. Một số trong số này là có sẵn trong gói phần mềm OpenCV's Machine Learning • Image sampling and view transformations. Thường hữu ích để xử lý một nhóm các điểm ảnh như một khối . OpenCV bao gồm giao diện cho tiểu vùng trích xuất hình ảnh, lấy mẫu ngẫu nhiên, thay đổi kích thước, cong vênh, xoay, và các hiệu ứng quan điểm áp dụng . • Methods for creating and analyzing binary (two-valued) images Ảnh nhị phân thường được sử dụng trong các hệ thống kiểm tra mà quét phát hiện các khuyết tật hoặc trong các bộ đếm. Ảnh nhị phân cũng thuận tiện khi định vị trí một đối tượng để nắm bắt . • Methods for computing 3D information. Các chức năng này rất hữu ích để lập bản đồ và nội địa hoá hoặc với nhiều quan góc nhìn từ một máy ảnh. • Math routines for image processing, computer vision, and image interpretation. OpenCV bao gồm các thuật toán toán học thường được sử dụng trong đại số tuyến tính, thống kê, và hình học tính toán. • Graphics. Các interface này cho phép bạn viết văn bản và vẽ trên hình ảnh. Ngoài ra, các chức năng này rất hữu ích cho việc ghi nhãn và đánh dấu . Ví dụ, nếu bạn viết một chương trình phát hiện đối tượng, nó rất hữu ích để nhãn hình ảnh với kích cỡ và vị trí của họ. • GUI methods OpenCV bao gồm các interface windown riêng của nó. Trong khi đây là những hạn chế so với những gì có thể được thực hiện trên các nền tảng khác, họ cung cấp một đơn giản, đa nền tảng API để hiển thị hình ảnh, chấp nhận đầu vào người dùng thông 4 Xử lý ảnh Lê Xuân Arithmetic Sequences Arithmetic Sequences By: OpenStaxCollege Companies often make large purchases, such as computers and vehicles, for business use The book-value of these supplies decreases each year for tax purposes This decrease in value is called depreciation One method of calculating depreciation is straight-line depreciation, in which the value of the asset decreases by the same amount each year As an example, consider a woman who starts a small contracting business She purchases a new truck for $25,000 After five years, she estimates that she will be able to sell the truck for $8,000 The loss in value of the truck will therefore be $17,000, which is $3,400 per year for five years The truck will be worth $21,600 after the first year; $18,200 after two years; $14,800 after three years; $11,400 after four years; and $8,000 at the end of five years In this section, we will consider specific kinds of sequences that will allow us to calculate depreciation, such as the truck’s value Finding Common Differences The values of the truck in the example are said to form an arithmetic sequence because they change by a constant amount each year Each term increases or decreases by the same constant value called the common difference of the sequence For this sequence, the common difference is –3,400 The sequence below is another example of an arithmetic sequence In this case, the constant difference is You can choose any term of the sequence, and add to find the subsequent term 1/24 Arithmetic Sequences A General Note Arithmetic Sequence An arithmetic sequence is a sequence that has the property that the difference between any two consecutive terms is a constant This constant is called the common difference If a1 is the first term of an arithmetic sequence and d is the common difference, the sequence will be: {an} = {a1, a1 + d, a1 + 2d, a1 + 3d, } Finding Common Differences Is each sequence arithmetic? If so, find the common difference {1, 2, 4, 8, 16, } { − 3, 1, 5, 9, 13, } Subtract each term from the subsequent term to determine whether a common difference exists The sequence is not arithmetic because there is no common difference The sequence is arithmetic because there is a common difference The common difference is Analysis The graph of each of these sequences is shown in [link] We can see from the graphs that, although both sequences show growth, a is not linear whereas b is linear Arithmetic sequences have a constant rate of change so their graphs will always be points on a line 2/24 Arithmetic Sequences Q&A If we are told that a sequence is arithmetic, we have to subtract every term from the following term to find the common difference? No If we know that the sequence is arithmetic, we can choose any one term in the sequence, and subtract it from the subsequent term to find the common difference Try It Is the given sequence arithmetic? If so, find the common difference {18, 16, 14, 12, 10, … } The sequence is arithmetic The common difference is – Try It Is the given sequence arithmetic? If so, find the common difference {1, 3, 6, 10, 15, … } The sequence is not arithmetic because − ≠ − Writing Terms of Arithmetic Sequences Now that we can recognize an arithmetic sequence, we will find the terms if we are given the first term and the common difference The terms can be found by beginning 3/24 Arithmetic Sequences with the first term and adding the common difference repeatedly In addition, any term can also be found by plugging in the values of n and d into formula below an = a1 + (n − 1)d How To Given the first term and the common difference of an arithmetic sequence, find the first several terms Add the common difference to the first term to find the second term Add the common difference to the second term to find the third term Continue until all of the desired terms are identified Write the terms separated by commas within brackets Writing Terms of Arithmetic Sequences Write the first five terms of the arithmetic sequence with a1 = 17 and d = − Adding − is the same as subtracting Beginning with the first term, subtract from each term to find the next term The first five terms are {17, 14, 11, 8, 5} Analysis As expected, the graph of the sequence consists of points on a line as shown in [link] Try It List the first five terms of the arithmetic sequence with a1 = and d = {1, 6, 11, 16, 21} 4/24 Arithmetic Sequences How To Given any the first term and any other term in an arithmetic sequence, find a given term Substitute the values given for a1, an, n into the formula an = a1 + (n − 1)d to solve for d Find a given term by substituting the appropriate values for a1, n, and d into the formulaan = a1 + (n − 1)d Writing Terms of Arithmetic Sequences Given a1 = and a4 = 14, find a5 The sequence can be written in terms of the initial term and the common difference d {8, + d, + 2d, + 3d} We know the fourth term equals 14; we know the fourth term has the form a1 + 3d = + 3d We can find the common difference d an = ... C H A P T E R 7 ■ ■ ■ 137 Effect: Animated Image Sequences Not all animations in an application are dynamic. It is often desirable to create the animations in a dedicated tool and then play the animation in the app. JavaFX has good support for video, for example, but sometimes video is too heavy of a solution. Or perhaps you want to have an animation sequence with partial transparency or be able to specify exactly which frames of the animation are visible when. In these cases, animating a sequence of image files can produce desirable results, and as a bonus, most animation software supports exporting image sequences directly. This chapter discusses strategies for creating images and displaying the sequence as an animation in a JavaFX scene. By displaying one image at a time an animation will be created, much like an old film movie where each frame is a picture on the filmstrip. This will be implemented using a few core JavaFX classes, such as Image and ImageView. The number of images that can be used to create animations like this is surprisingly high, but some effort must be made to do this without ruining the performance of your application. But before we get to the code, let’s first discuss how to create the images. Creating Images There are excellent tools available for creating animations, and you should feel free to use any tool you are comfortable with. Some are better suited for 2D animations, such as Adobe’s After Effects, and other tools are better at 3D. For 3D I can’t recommend Blender enough. The learning curve is amazingly steep, but after 20 hours or so you will find yourself able to create any shape you can think of. You will also find video tutorials for all animation tools online, and I find this a good way to learn. Conduct a web search for “Blender tutorial videos,” take your pick from the results, and start following along. And check out the Blender web site at http://www.blender.org/education-help/, which contains documentation and videos to assist you. Figure 7-1 shows a Blender project set up to create an animation. The plethora of buttons on the screen hints at Blender’s power and learning curve. Download at WoweBook.com CHAPTER 7 ■ EFFECT: ANIMATED IMAGE SEQUENCES 138 Figure 7-1. Blender If you choose to explore Blender as a tool for creating content in your JavaFX scenes, remember that you can add as much detail as you want. You can also render the animation with the most time- consuming rendering options if you want. This is the real beauty of pre-rendering these animations: Once the work is committed to a sequence of images, it does not matter how complex your 3D scene is. All of that detail is presented to the user in a fluid animation. If the JavaFX scene you are creating will contain multiple image sequences, then it is best to track how each item is lit. Combining content that looks 3D to the user will be confusing if one item seems to be lit from the left and another is lit from the right. An example of this can be seen in Figure 7-2. CHAPTER 7 ■ EFFECT: ANIMATED IMAGE SEQUENCES 139 Figure 7-2. Multiple asteroids with consistent lighting CHAPTER 7 ■ EFFECT: ANIMATED IMAGE SEQUENCES 140 Figure 7-2 shows four different asteroid sequences that are all animated with several light sources, but in the same location for each asteroid. This gives them a consistency within the scene. Note that the buildings at the bottom are also illuminated in a way consistent to each other. You can also see that the light on the asteroids might be coming slightly from the left, while on the buildings the light is coming from the right. This is inconsistent, but I think it is close enough for a $1 game. One criterion for this exercise is that the animation tool must be able to export the frames of the animation as a sequence of images that JavaFX knows how to read. I find PNG Annals of Mathematics An uncertainty principle for arithmetic sequences By Andrew Granville and K. Soundararajan* Annals of Mathematics, 165 (2007), 593–635 An uncertainty principle for arithmetic sequences By Andrew Granville and K. Soundararajan* Abstract Analytic number theorists usually seek to show that sequences which ap- pear naturally in arithmetic are “well-distributed” in some appropriate sense. In various discrepancy problems, combinatorics researchers have analyzed lim- itations to equidistribution, as have Fourier analysts when working with the “uncertainty principle”. In this article we find that these ideas have a natural setting in the analysis of distributions of sequences in analytic number theory, formulating a general principle, and giving several examples. 1. Introduction In this paper we investigate the limitations to the equidistribution of in- teresting “arithmetic sequences” in arithmetic progressions and short intervals. Our discussions are motivated by a general result of K. F. Roth [15] on irregu- larities of distribution, and a particular result of H. Maier [11] which imposes restrictions on the equidistribution of primes. If A is a subset of the integers in [1,x] with |A| = ρx then, as Roth proved, there exists N ≤ x and an arithmetic progression a (mod q) with q ≤ √ x such that     n∈A,n≤N n≡a (mod q) 1 − 1 q  n∈A n≤N 1      ρ(1 − ρ)x 1 4 . In other words, keeping away from sets of density 0 or 1, there must be an arithmetic progression in which the number of elements of A is a little different from the average. Following work of A. Sarkozy and J. Beck, J. Matousek and J. Spencer [12] showed that Roth’s theorem is best possible, in that there is a *Le premier auteur est partiellement soutenu par une bourse du Conseil de recherches en sciences naturelles et en g´enie du Canada. The second author is partially supported by the National Science Foundation. 594 ANDREW GRANVILLE AND K. SOUNDARARAJAN set A containing ∼ x/2 integers up to x, for which |#{n ∈A: n ≤ N, n ≡ a (mod q)}−#{n ∈A: n ≤ N }/q|x 1/4 for all q and a with N ≤ x. Roth’s result concerns arbitrary sequences of integers, as considered in combinatorial number theory and harmonic analysis. We are more interested here in sets of integers that arise in arithmetic, such as the primes. In [11] H. Maier developed an ingenious method to show that for any A ≥ 1 there are arbitrarily large x such that the interval (x, x+ (log x) A ) contains significantly more primes than usual (that is, ≥ (1 +δ A )(log x) A−1 primes for some δ A > 0) and also intervals (x, x + (log x) A ) containing significantly fewer primes than usual. Adapting his method J. Friedlander and A. Granville [3] showed that there are arithmetic progressions containing significantly more (and others with significantly fewer) primes than usual. A weak form of their result is that, for every A ≥ 1 there exist large x and an arithmetic progression a (mod q) with (a, q) = 1 and q ≤ x/(log x) A such that    π(x; q, a) − π(x) φ(q)     A π(x) φ(q) .(1.1) If we compare this to Roth’s bound we note two differences: the discrepancy exhibited is much larger in (1.1) (being within a constant factor of the main term), but the modulus q is much closer to x (but not so close as to be trivial). Recently A. Balog and T. Wooley [1] proved that the sequence of integers that may be written as the sum of two squares also exhibits “Maier type” irregularities in some intervals (x, x+(log x) A ) for any fixed, positive A. While previously Maier’s results on primes had seemed inextricably linked to the mysteries of the primes, Balog and Wooley’s example suggests that such results should be part of a general phenomenon. Indeed, we will provide here a general framework for such results on irregularities of distribution, which Thue-like sequences and rainbow arithmetic progressions Jaroslaw Grytczuk Institute of Mathematics, University of Zielona G´ora, 65-246 Zielona G´ora, Poland J.Grytczuk@im.uz.zgora.pl Submitted: October 21, 2002; Accepted: November 6, 2002. MR Subject Classifications: 05C38, 15A15, 15A18 Abstract A sequence u = u 1 u 2 u n is said to be nonrepetitive if no two adjacent blocks of u are exactly the same. For instance, the sequence abcbcba contains a repetition bcbc, while abcacbabcbac is nonrepetitive. A well known theorem of Thue asserts that there are arbitrarily long nonrepetitive sequences over the set {a, b, c}.Thisfact implies, via K¨onig’s Infinity Lemma, the existence of an infinite ternary sequence without repetitions of any length. In this paper we consider a stronger property defined as follows. Let k ≥ 2 be a fixed integer and let C denote a set of colors (or symbols). A coloring f : → C of positive integers is said to be k-nonrepetitive if for every r ≥ 1each segment of kr consecutive numbers contains a k-term rainbow arithmetic progression of difference r. In particular, among any k consecutive blocks of the sequence f = f(1)f (2)f (3) no two are identical. By an application of the Lov´asz Local Lemma we show that the minimum number of colors in a k-nonrepetitive coloring is at most 2 −1 e k(2k−1)/(k−1) 2 k 2 (k − 1) + 1. Clearly at least k + 1 colors are needed but whether O(k) suffices remains open. This and other types of nonrepetitiveness can be studied on other structures like graphs, lattices, Euclidean spaces, etc., as well. Unlike for the classical Thue sequences, in most of these situations non-constructive arguments seem to be un- avoidable. A few of a range of open problems appearing in this area are presented at the end of the paper. Keywords: nonrepetitive sequence, rainbow arithmetic progression, chessboard coloring 1 Introduction In this paper we consider another variant of the nonrepetitive sequences of Thue. A finite sequence u = u 1 u 2 u n of symbols from a set C is called nonrepetitive if it does the electronic journal of combinatorics 9 (2002), #R44 1 not contain a sequence of the form xx = x 1 x 2 x m x 1 x 2 x m , x i ∈ C, as a subsequence of consecutive terms. For instance the sequence u = abcacbabcbac over the set C = {a, b, c} is nonrepetitive, while v = abcbcba is not. A striking theorem of Thue [25] asserts that there exist arbitrarily long nonrepetitive sequences built of only three different symbols. Note that this fact implies also the existence of an infinite nonrepetitive sequence over a 3-element set. Nonrepetitive sequences were rediscovered independently many times in connection with problems appearing in seemingly distant areas of mathematics (see [1], [12], [19], [22]). Their important applications in Combinatorics on Words, Group Theory, Universal Algebra, Number Theory and Dynamical Systems are well known (see [1], [4], [7], [17- 20], [23]). Also, a lot of similar concepts were invented leading to new exciting forms of nonrepetitiveness (see [8-16]). Needless to say, a stream of investigations inspired by Thue’s discovery seems to expand in ever-widening circles. Let us mention for example a recent graph theoretic variation introduced in [2]. A coloring of the set of edges of a graph G is called nonrepetitive if the sequence of colors on any simple path in G is nonrepetitive. The minimum number of colors needed is called the Thue number of G and is denoted by π(G). For instance, Thue’s theorem asserts that π(P n ) = 3, for all n ≥ 4, where P n is the simple path with n edges. It has been proved in [2] that there is an absolute constant c such that π(G) ≤ c∆ 2 for all graphs G with maximum degree at most ∆. The proof uses the probabilistic method and at the moment no constructive argument is known for any ∆ ≥ 3. The purpose of this paper is to study higher order nonrepetitiveness involving arith- metic progressions. Let k ≥ 2 be a fixed integer and let f : → C be a coloring of the A sequence in which a constant (d) can be added to each term to get the next term is called an Arithmetic Sequence The constant (d) is called the Common Difference To find the common difference (d), subtract any term from one that follows it t1 t2 t3 t4 t5 11 14 3 3 Find the first term and the common difference of each arithmetic sequence 1.) 4,9,14,19, 24 First term (a): Common difference (d): a2 − a1 = – = 2.) 34, 27, 20,13,6, −1, −8, First term (a): 34 Common difference (d): -7 BE CAREFUL: ALWAYS CHECK TO MAKE SURE THE DIFFERENCE IS THE SAME BETWEEN EACH TERM ! Now you try! Find the first term and the common difference of each of these arithmetic sequences a) 1, -4, -9, -14, … b) 11, 23, 35, 47, … Answers with solutions a) 1, -4, -9, -14, … a=1 and d = a - a1 = - - = - b) 11, 23, 35, 47, … a = 11 and d = a2 - a1 = 23 - 11 = 12 The first term of an arithmetic sequence is (a) We add (d) to get the next term There is a pattern, therefore there is a formula we can use to give use any term that we need without listing the whole sequence  3, 7, 11, 15, … We know a = and d = t1= a = t2= a+d = 3+4 = t3= a+d+d = a+2d = 3+2(4) t4 = a+d+d+d = a+3d = 3+3(4) = 11 = 15 The first term of an arithmetic sequence is (a) We add (d) to get the next term There is a pattern, therefore there is a formula (explicit formula) we can use to give use any term that we need without listing the whole sequence  The nth term of an arithmetic sequence is given by: n t = a + (n – 1) d The last # in the sequence/or the # you are looking for First term The position the term is in The common difference Find the 14th term of the arithmetic sequence 4, 7, 10, 13, …… tn = a + (n – 1) d t14 = + (14 − 1) = + (13)3 You are looking for the term! = + 39 = 43 The 14th term in this sequence is the number 43! Now you try! Find the 10th and 25th term given the following information Make sure to derive the general formula first and then list ehat you have been provided a) 1, 7, 13, 19 … b) The first term is and the common difference is -21 c) The second term is and the common difference is Answers with solutions a) 1, 7, 13, 19 … … a=1 and d = a2 - a1 = – = tn=a+(n-1)d = + (n-1) = 1+6n-6 So tn = 6n-5 t10 = 6(10) – = 55 t25 = 6(25)-5 = 145 b) The first term is and the common difference is -21 a=3 and d = -21 tn=a+(n-1)d = + (n-1) -21 = 3-21n+21 t10 = 24-21(10) = -186 t25 = 24-21(25) = -501 c) The second term is a=8-3 =5 and the common difference is tn=a+(n-1)d = + (n-1) = 5+3n-3 t10 = 3(10) +2 = 32 So tn= 24-21n and d =3 So tn = 3n+2 t25 = 3(25)+2 = 77 a = and d = -6 Find the 14th term of the arithmetic sequence with first term of and the common difference is –6 tn = a + (n – 1) d You are looking for the term! List which variables from the general term are provided! + (14 − 1) -6 = + (13) * -6 = + -78 = -73 The 14th term in this sequence is the number -73! t14 = In the arithmetic sequence 4,7,10,13,…, which term has a value of 301? tn = a + (n – 1) d 301 = + (n − 1)3 301 = + 3n − 301 = + 3n 300 = 3n 100 = n You are looking for n! The 100th term in this sequence is 301! In an arithmetic sequence, term 10 is 33 and term 22 is –3 What are the first four terms of the sequence? t10=33 Use what you know! t22= -3 For term 10: tn = a + (n – 1) d 33= a + 9d For term 22: tn = a + (n – 1) d -3= a + 21d HMMM! Two equations you can solve! 33 = a + 9d SOLVE: 33 = a+9d SOLVE: By elimination -3 = a+21d 33 = a +9(-3) 36 = 12d 33 = a –27 -3 = d 60 = a - The sequence is 60, 57, 54, 51, …… What is a Geometric Sequence? • In a geometric sequence, the ratio between consecutive terms is constant This ratio is called the common ratio • Unlike in an arithmetic sequence, the difference between consecutive terms varies • We look for multiplication to identify geometric sequences Ex: Determine if the sequence is geometric If so, identify the common ratio • 1, -6, 36, -216 yes Common ratio=-6 ... − 1)d Try It Given a3 = and a5 = 17, find a2 5/24 Arithmetic Sequences a2 = Using Recursive Formulas for Arithmetic Sequences Some arithmetic sequences are defined in terms of the previous term... practice with arithmetic sequences • Arithmetic Sequences Key Equations recursive formula for nth term of an arithmetic sequence an = an − + d explicit formula for nth term of an arithmetic sequence... determine whether the graph shown represents an arithmetic sequence 18/24 Arithmetic Sequences 19/24 Arithmetic Sequences The graph does not represent an arithmetic sequence For the following exercises,

Ngày đăng: 31/10/2017, 13:33

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN

w