TIỂU LUẬN GIỮA kỳ môn xác SUẤT THỐNG kê ỨNG DỤNG CHO CÔNG NGHỆ THÔNG TIN

49 20 0
TIỂU LUẬN GIỮA kỳ môn xác SUẤT THỐNG kê ỨNG DỤNG CHO CÔNG NGHỆ THÔNG TIN

Đ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

TỔNG LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ MÔN: XÁC SUẤT THỐNG KÊ ỨNG DỤNG CHO CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ Người hướng dẫn: TS NGUYỄN QUỐC BÌNH Người thực hiện: LÂM QUANG HUY Lớp : Khố THÀNH PHỐ HỒ CHÍ MINH, NĂM 2022 21H50201 : K25 TỔNG LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ MÔN: XÁC SUẤT THỐNG KÊ ỨNG DỤNG CHO CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ Người hướng dẫn: TS NGUYỄN QUỐC BÌNH Người thực hiện: LÂM QUANG HUY Lớp : 21H50201 Khoá : K25 THÀNH PHỐ HỒ CHÍ MINH, NĂM 2022 LỜI CẢM ƠN Em cảm ơn thầy Nguyễn Quốc Bình giảng dạy cho em kiến thức lập trình ứng dụng xác suất thống kê hướng dẫn em thực tiểu luận kỳ CƠNG TRÌNH ĐƯỢC HỒN THÀNH TẠI TRƯỜNG ĐẠI HỌC TƠN ĐỨC THẮNG Tơi xin cam đoan cơng trình nghiên cứu riêng tơi hướng dẫn khoa học TS Nguyễn Văn A; Các nội dung nghiên cứu, kết đề tài trung thực chưa công bố hình thức trước Những số liệu bảng biểu phục vụ cho việc phân tích, nhận xét, đánh giá tác giả thu thập từ nguồn khác có ghi rõ phần tài liệu tham khảo Ngồi ra, luận văn cịn sử dụng số nhận xét, đánh số liệu tác giả khác, quan tổ chức khác có trích dẫn thích nguồn gốc Nếu phát có gian lận tơi xin hoàn toàn chịu trách nhiệm nội dung luận văn Trường đại học Tơn Đức Thắng khơng liên quan đến vi phạm tác quyền, quyền tơi gây q trình thực (nếu có) TP Hồ Chí Minh, ngày 26 tháng 10 năm 2022 Tác giả (ký tên ghi rõ họ tên) Lâm Quang Huy TÓM TẮT Bài tiểu luận phần tóm tắt kiến thức mà học sinh học khoảng thời gian kì Về việc áp dụng kiến thức môn xác suất thống kê học phần lí thuyết kết hợp phương pháp lập trình Python học lớp thực hành để giải số tốn.Trong có cụ thể nội dung nhóm chức mơ đun statistics thư viện Python Học sinh thực phần: phần viết code thuật toán cân Histogram để xử lí ảnh phần viết báo cáo (3 chương) Cuối phần tiểu luận nguồn tài liệu học sinh tham khảo để làm tiểu luận MỤC LỤC LỜI CẢM ƠN CƠNG TRÌNH ĐƯỢC HỒN THÀNH TẠI TRƯỜNG ĐẠI HỌC TƠN ĐỨC THẮNG TĨM TẮT MỤC LỤC CHAPTER – OPENING 1.1 Statistics library in Python 1.1.1 Gererality about Statistics library in Python 1.1.2 Some functions relate to Statistisc library 1.1.2.10 statistics.multimode(data) 1.1.2.11 statistics.quantile(data) 1.1.2.12 Statistics.pstdev(data, mu=None) 1.1.2.13 Statistics pvariance(data, mu=None) 1.1.2.14 Statistics.stdev(data, xbar=None) 1.1.2.15 Statistics variance(data, mu=None) 1.1.2.16 Statistics convariance(x, y, /) 1.1.2.17 statistics.correlation(x, y, /) 1.1.2.18 statistics.correlation(x, y, /) CHAPTER – HISTOGRAM EQUALIZATION ALGORITHM 2.1.Histogram equalization algorithm 2.2 Example about Histogram equalization algorithm 2.3 My comment, analysis, evaluation CHAPTER 3- IMPLEMENTATION 3.1.Implementation TÀI LIỆU THAM KHẢO 45 PHỤ LỤC 46 CHAPTER – OPENING 1.1 Statistics library in Python 1.1.1 Gererality about Statistics library in Python In the era of big data and artificial intelligence, data science and machine learning have become essential in many fields of science and technology A necessary aspect of working with data is the ability to describe, summarize, and represent data visually Python statistics libraries are comprehensive, popular, and widely used tools that will assist you in working with data This module provides functions for calculating mathematical statistics of numeric (Real-valued) data The module is not intended to be a competitor to third-party libraries such as NumPy, SciPy, or proprietary full-featured statistics packages aimed at professional statisticians such as Minitab, SAS and Matlab It is aimed at the level of graphing and scientific calculators Descriptive statistics is about describing and summarizing data It uses two main approaches: - The quantitative approach describes and summarizes data numerically - The visual approach illustrates data with charts, plots, histograms, and other graphs 1.1.2 Some functions relate to Statistisc library Averages and measures of central location: - statistics.mean(data) - statistics.fmean(data) -statistics.geometric_mean(data) - statistics.harmonic_mean(data, weights=None) - statistics.median(data) - statistics.median_low(data) - statistics.median_high(data)¶ - statistics.median_grouped(data, interval=1) - statistics.mode(data) -statistics.multimode(data) Measures of spread: -statistics.pstdev(data, mu=None) -statistics.pvariance(data, mu=None) -statistics.stdev(data, xbar=None) -statistics.variance(data, xbar=None) Statistics for relations between two inputs: -statistics.covariance(x, y, /) -statistics.correlation(x, y, /) -statistics.linear_regression(x, y, /, *, proportional=False) 1.1.2.1 Statistics.mean(data) - mean() function can be used to calculate mean/average of a given list of numbers It returns mean of the data set passed as parameters -Arithmetic mean is the sum of data divided by the number of data-points It is a measure of the central location of data in a set of values which vary in range In Python, we usually this by dividing the sum of given numbers with the count of number present -Syntax : mean([data-set]) -Parameters : -[data-set] : List or tuple of a set of numbers -Returns : Sample arithmetic mean of the provided data-set -Exceptions : TypeError when anything other than numeric values are passed as parameter -Example: 1.1.2.2 Statistics.fmean(data) -A function fmean() converts all the data into float data-type and then computes the arithmetic mean or average of data that is provided in the form of a sequence or an iterable The output of this function is always a float 33 34 1.1.2.16 Statistics convariance(x, y, /) - Return the sample covariance of two inputs x and y Covariance is a measure of the joint variability of two inputs - Both inputs must be of the same length (no less than two), otherwise StatisticsError is raised - It’s represented through the formula: If COV(xi, xj) = then variables are uncorrelated If COV(xi, xj) > then variables positively correlated If COV(xi, xj) > < then variables negatively correlated - Parameters: + x : [array_like] A 1D or 2D variables variables are columns + y : [array_like] It has the same form as that of m -Returns: It returns ndarray covariance matrix -Example: 35 1.1.2.17 statistics.correlation(x, y, /) -Return the Pearson’s correlation coefficient for two inputs Pearson’s correlation coefficient r takes values between -1 and +1 It measures the strength and direction of the linear relationship, where +1 means very strong, positive linear relationship, -1 very strong, negative linear relationship, and no linear relationship -Both inputs must be of the same length (no less than two), and need not to be constant, otherwise StatisticsError is raised - Parameters: The statistics.correlation() method takes the x and y parameters which represent the x and y values for which the correlation coefficient is to be determined - Return value: The statistics.correlation() method returns the Pearson’s correlation coefficient for two given inputs - Example: 36 1.1.2.18 statistics.correlation(x, y, /) -Return the slope and intercept of simple linear regression parameters estimated using ordinary least squares Simple linear regression describes the relationship between an independent variable x and a dependent variable y in terms of this linear function: y = slope * x + intercept + noise -where slope and intercept are the regression parameters that are estimated, and noise represents the variability of the data that was not explained by the linear regression (it is equal to the difference between predicted and actual values of the dependent variable) - Both inputs must be of the same length (no less than two), and the independent variable x cannot be constant; otherwise a StatisticsError is raised - For example, we can use the release dates of the Monty Python films to predict the cumulative number of Monty Python films that would have been produced by 2019 assuming that they had kept the pace - If proportional is true, the independent variable x and the dependent variable y are assumed to be directly proportional The data is fit to a line passing through the origin Since the intercept will always be 0.0, the underlying linear function simplifies to: 37 y = slope * x + noise -Example: 38 CHAPTER – HISTOGRAM EQUALIZATION ALGORITHM 2.1 Histogram equalization algorithm - Histogram equalization is a basic image processing technique that adjusts the global contrast of an image by updating the image histogram’s pixel intensity distribution Doing so enables areas of low contrast to obtain higher contrast in the output image -In the field of image processing, a histogram used to statistics the number of times that light levels occur in an image Essentially, histogram equalization works by: Computing a histogram of image pixel intensities Evenly spreading out and distributing the most frequent pixel values (i.e., the ones with the largest counts in the histogram) Giving a linear trend to the cumulative distribution function (CDF) -The result of applying histogram equalization is an image with higher global contrast -We can further improve histogram equalization by applying an algorithm called Contrast Limited Adaptive Histogram Equalization (CLAHE), resulting in higher quality output images -Other than photographers using histogram equalization to correct under/over-exposed images, the most widely used histogram equalization application can be found in the medical field 39 -You’ll typically see histogram equalization applied to X-ray scans and CT scans to improve the radiograph’s contrast Doing so helps doctors and radiologists better interpret the scans and make an accurate diagnosis -By the end of this tutorial, you will be able to successfully apply both basic histogram equalization and adaptive histogram equalization to images with OpenCV - The algorithm will work most with Opencv library 2.2 Example about Histogram equalization algorithm -Applying histogram equalization starts by computing the histogram of pixel intensities in an input grayscale/single-channel image: -Notice how our histogram has numerous peaks, indicating there are a good number of pixels binned to those respective buckets With histogram equalization, our goal is to spread these pixels to buckets that don’t have as many pixels binned to them -Mathematically, what this means is that we’re attempting to apply a linear trend to our cumulative distribution function (CDF): 40 The before and after histogram equalization application can be seen in Figure 3: -With adaptive histogram equalization, we divide an input image into an M x N grid We then apply equalization to each cell in the grid, resulting in a higher quality output image: 41 -The downside is that adaptive histogram equalization is by definition more computationally complex (but given modern hardware, both implementations are still quite speedy) 2.3 My comment, analysis, evaluation -In this tutorial, you learned how to perform both basic histogram equalization and adaptive histogram equalization with OpenCV -Basic histogram equalization aims to improve the global contrast of an image by “spreading out” pixel intensities often used in the image 42 CHAPTER 3- IMPLEMENTATION 3.1 Implementation Instruction for building and running my sourcecode: Import the library and the image Build the function of calculating Histogram Build Histogram equilibrium function 43 My code: 44 Result: The orginal 45 My equalize The binary image The chart show the histogram of binary image and the equalized image 46 TÀI LIỆU THAM KHẢO Tiếng Việt https://docs.python.org/3/library/statistics.html Tiếng Anh https://www.geeksforgeeks.org 47 PHỤ LỤC Phần bao gồm nội dung cần thiết nhằm minh họa hỗ trợ cho nội dung luận văn số liệu, biểu mẫu, tranh ảnh sử dụng câu trả lời cho bảng câu hỏi bảng câu hỏi mẫu phải đưa vào phần Phụ lục dạng nguyên dùng để điều tra, thăm dò ý kiến; khơng tóm tắt sửa đổi Các tính tốn mẫu trình bày tóm tắt biểu mẫu cần nêu Phụ lục luận văn Phụ lục khơng dày phần luận văn ... VIỆT NAM TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ MÔN: XÁC SUẤT THỐNG KÊ ỨNG DỤNG CHO CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ Người hướng dẫn: TS NGUYỄN QUỐC BÌNH Người... 2022 LỜI CẢM ƠN Em cảm ơn thầy Nguyễn Quốc Bình giảng dạy cho em kiến thức lập trình ứng dụng xác suất thống kê hướng dẫn em thực tiểu luận kỳ 2 CƠNG TRÌNH ĐƯỢC HỒN THÀNH TẠI TRƯỜNG ĐẠI HỌC TƠN... ghi rõ họ tên) Lâm Quang Huy TÓM TẮT Bài tiểu luận phần tóm tắt kiến thức mà học sinh học khoảng thời gian kì Về việc áp dụng kiến thức mơn xác suất thống kê học phần lí thuyết kết hợp phương pháp

Ngày đăng: 29/12/2022, 04:00

Tài liệu cùng người dùng

Tài liệu liên quan