BÀI tập lớn đề tài xử lý ẢNH BẰNG MATLAB

31 6 0
BÀI tập lớn đề tài xử lý ẢNH BẰNG MATLAB

Đ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

ĐẠI HỌC ĐÀ NẴNG KHOA CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG BÀI TẬP LỚN ĐỀ TÀI: XỬ LÝ ẢNH BẰNG MATLAB Sinh viên thực : ÔNG BỬU KHÁNH NGUYỄN VĂN THẢO BÙI VĂN KHIÊM PHAN TRÍ DŨNG Giảng viên hướng dẫn : TS PHAN THỊ LAN ANH Lớp : 18IT5 – 18IT3 Đà nẵng, tháng 05 năm 2021 ĐẠI HỌC ĐÀ NẴNG KHOA CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG BÀI TẬP LỚN ĐỀ TÀI: XỬ LÝ ẢNH BẰNG MATLAB Sinh viên thực Giảng viên hướng dẫn Lớp : ÔNG BỬU KHÁNH NGUYỄN VĂN THẢO BÙI VĂN KHIÊM PHAN TRÍ DŨNG : TS PHAN THỊ LAN ANH : 18IT5 -18IT3 LỜI MỞ ĐẦU Trong lĩnh vực đời sống nay, xử lý ảnh ứng dụng cách rộng rãi đem lại nhiều kết khả quan Mặt khác cịn hứa hẹn tương lai phát triển với phát triển công nghệ tiên tiến Cụ thể y học, chẩn đốn hình ảnh phương pháp chẩn đốn cho phép người bác sĩ quan sát hình ảnh phận thể cách trực quan Từ đưa chẩn đốn xác bệnh lý để có biện pháp điều trị hiệu Khoa học hỗ trợ cho kĩ thuật chẩn đốn hình ảnh xử lý ảnh… Trong luận văn này, chúng em tập trung tìm hiểu phương pháp, thuật tốn nâng cao chất lượng ảnh nói chung, tìm hiểu số phương pháp cụ thể nâng cao chất lượng ảnh, cài đặt chương trình với số chức để thực nghiệm kết Trong trình thực luận văn, có nhiều cố gắng, nỗ lực tránh khỏi thiếu sót, hạn chế điều kiện thời gian ,kiến thức khả có hạn Chúng em xin chân thành mong nhận góp ý ,chỉ bảo thầy giáo, cô giáo bạn học để hồn thiện luận văn, chương trình để có kiến thực thực tế bổ ích áp dụng qúa trình làm việc nghiên cứu sau BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB LỜI CẢM ƠN Nhóm đồ án chúng em xin gửi lời cảm ơn đến cô Tiến Sĩ Phan Thị Lan Anh – giảng viên hướng dẫn tập lớn trang bị cho em kiến thức, kỹ cần có để hồn thành đề tài Tuy nhiên trình nghiêm cứu đề tài, kiến thức chun ngành cịn hạn chế nên nhóm chúng em cịn nhiều thiếu sót tìm hiểu, đánh giá trình bày đề tài Rất mong nhận quan góp ý thầy/cơ mơn để tài em đầy đủ hoàn chỉnh Xin chân thành cảm ơn BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB NHẬN XÉT ………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… …………………………………………………………………………… BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB MỤC LỤC LỜI MỞ ĐẦU Chương 1: Giới thiệu 10 1.1 Tổng quan 10 1.2 Mục đích .10 1.3 Phương pháp .11 1.3.1 Đối tượng 11 1.3.2 Phạm vi nghiên cứu 11 1.4 Cấu trúc đồ án .11 Chương 1.1: Nghiên cứu tổng quan 12 2.1 Các phương pháp .12 2.1.1 Bài tốn nhận diện khn mặt 12 2.1.2 Tổng quan kiến trúc hệ thống nhận dạng khuôn mặt .13 2.1.3 Xác định khn hình trang khuôn mặt 13 2.2 Các công nghệ thực khái niệm liên quan 14 2.2.1 Giới thiệu ngơn ngữ lập trình Python .15 2.2.2 Giới thiệu thư viện OpenCV 15 2.2.3 Deep Learning 16 2.2.4 Thư viện Deep Learning – Keras/Deep Learning 17 2.3 Hạn chế, tồn phương pháp 18 Chương 3: Phân tích thiết kế hệ thống 20 3.1 Mơ hình tổng quan hệ thống nghiên cứu 20 3.1.1 Luồng hoạt động hệ thống 20 3.2 Phân tích chi tiết luồng hoạt động hệ thống 21 3.2.1 Giai đoạn huấn luyện liệu cho hệ thống .21 3.2.2 Giai đoạn áp dụng triển khai phân tích nhận diện hệ thống .22 3.3 Phân tích tập liệu (dataset) 23 3.3.1 Xây dựng tập liệu 23 Chương 4: Triển khai xây dựng .28 4.1 Cấu trúc dự án 28 BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB 4.2 Triển khai kịch huấn luyện (training) hệ thống nhận diện trang 28 4.3 Tiến hành huấn luyện hệ thống nhận diện trang với Keras/Tensorflow 35 4.4 Triển khai nhận diện trang với video stream qua webcam 36 Chương 5: Kết luận hướng phát triển 42 5.1 Kết luận .42 5.2 Hướng phát triển 42 BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB DANH MỤC HÌNH Hình Hình Hình Hình Hình Hình Hình Hình Hình Hình Hình Hình Hình Hình Hình 1-Hệ thống nhận diện khuôn mặt .13 2-Các bước hệ thống nhận dạng .14 3-Giới thiệu thư viện OpenCV 17 4-Sơ đồ luồng hoạt động hệ thống 21 5-Sơ đồ luồng hoạt động giai đoạn Train liệu 22 6-Sơ đồ luồng hoạt động phân tích nhận diện hệ thống 23 7-Bức ảnh người không đeo trang .24 8-Nhận diện khuôn mặt ảnh nhờ Deep Learning .25 9-Trích xuất ROI khuôn mặt với OpenCV NumPy cắt 26 10-Đánh dấu điểm mốc khuôn mặt 26 11-Hình trang 27 12-Hình ảnh trang đặt lên khuôn mặt .27 13-Bộ liệu ảnh đeo trang nhân tạo .28 14-Kết nhận diện khuôn mặt không mang trang 42 15-Kết nhận diện khn mặt có đeo trang 42 BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Chương 1: Giới thiệu 1.1 Tổng quan Phổ biến đời sống người làm cho lượng thông tin thu hình ảnh ngày tăng Theo đó, lĩnh vực xử lý ảnh trọng phát triển, ứng dụng rộng rãi đời sống xã hội đại Không dừng lại việc chỉnh sửa, tăng chất lượng hình ảnh mà với cơng nghệ xử lý ảnh giải tốn nhận dạng chữ viết, nhận dạng dấu vân tay, nhận dạng khn mặt… Trong đề tài, nhóm chúng em xây dựng chương trình xử lý ảnh, lọc ảnh nâng cao, tiền đề cở sở để phát triển sở đề án giải pháp vấn đề sống người lĩnh vực thương mại, trường học, bệnh viện,… 1.2 Mục đích Xây dựng chương trình xử lý ảnh dựng chương trình xử lý ảnh, lọc ảnh nâng cao, tiền đề cở sở để phát triển sở đề án giải pháp vấn đề sống người lĩnh vực thương mại, trường học, bệnh viện,… BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB 1.3 Phương pháp 1.3.1 Đối tượng - Các phương pháp, thuật toán phục vụ cho việc phát nhận dạng khuôn mặt người ảnh - Bộ thư viện xử lý ảnh OpenCv - Bộ thư viện xử lý nhận dạng Tensorflow - Phương pháp nhận diện học sâu Deep Learning 1.3.2 Phạm vi nghiên cứu - Tập trung tìm hiểu nhận dạng khn mặt (Face Recognition) Cơng nghệ theo dõi nhận dạng tập trung ROI (Region Of Interest) Xử lí ảnh khn mặt từ liệu đầu vào có sẵn huấn luyện để nhận diện Nhận dạng khuôn mặt với webcam phát mang trang không, đưa cảnh báo Cấu trúc đồ án Cấu trung đồ án gồm phần chính: - Chương 1: Giới thiệu tổng quan - Chương 2: Nghiên cứu tổng quan - Chương 3: Phân tích thiết kế hệ thống - Chương 4: Triển khai xây dựng - Chương 5: Kết luận hướng phát triển BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB (ví dụ: cách sử dụng Keras API liên quan đơn giản cho việc train model) Train phân tán dễ chạy nhờ vào API hỗ trợ cho TensorFlow Lite cho phép triển khai mơ hình nhiều tảng khác Tuy nhiên, viết code phiên trước TensorFlow bạn phải viết lại, đơi lúc ít, đơi lúc đáng kể, để tận dụng tối đa tính TensorFlow 2.0 2.3 Hạn chế, tồn phương pháp Bài toán nhận dạng mặt người toán nghiên cứu từ năm 70 Tuy nhiên, tốn khó nên nghiên cứu chưa đạt kết mong muốn Chính thế, vấn đề nhiều nhóm giới quan tâm nghiên cứu Khó khăn tốn nhận dạng mặt người kể đến sau: a Tư chụp, góc chụp: Ảnh chụp khn mặt thay đổi nhiều góc chụp camera khn mặt Chẳng hạn như: chụp thẳng, chụp chéo bên trái 45o hay chụp chéo bên phải 45o , chụp từ xuống, chụp từ lên, v.v… Với tư khác nhau, thành phần khuôn mặt mắt, mũi, miệng bị khuất phần chí khuất hết b Sự xuất thiếu số thành phần khuôn mặt: Các đặc trưng như: râu mép, râu hàm, mắt kính, v.v… xuất khơng Vấn đề làm cho tốn trở nên khó nhiều c Sự biểu cảm khuôn mặt: Biểu cảm khuôn mặt người làm ảnh hưởng đáng kể lên thơng số khuôn mặt Chẳng hạn, khuôn mặt người, khác họ cười sợ hãi, v.v… d Sự che khuất: Khuôn mặt bị che khuất đối tượng khác khuôn mặt khác e Hướng ảnh (pose variations): Các ảnh khn mặt biến đổi nhiều với góc quay khác trục camera Chẳng hạn chụp với trục máy ảnh nghiêng làm cho khuôn mặt bị nghiêng so với trục ảnh f Điều kiện ảnh: Ảnh chụp điều kiện khác về: chiếu sáng, tính chất camera (máy kỹ thuật số, máy hồng ngoại, v.v…), ảnh có chất lượng thấp ảnh hưởng nhiều đến chất lượng ảnh khuôn mặt g Aging condition: Việc nhận dạng ảnh mặt thay đổi theo thời gian vấn đề khó khăn, khả nhận dạng người BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Chương 3: Phân tích thiết kế hệ thống 3.1 Mơ hình tổng quan hệ thống nghiên cứu 3.1.1 Luồng hoạt động hệ thống Hình 4-Sơ đồ luồng hoạt động hệ thống Để tùy chỉnh việc huấn luyện nhận diện khuôn mặt đeo trang hệ thống ta chia gồm giai đoạn (phase) riêng biệt, giai đoạn có bước nhiệm vụ riêng (Như Hình 3.1.1 bên trên) Ta có giai đoạn sơ đồ: Giai đoạn 1: Huấn luyện liệu cho hệ thống (Train Face Mask Detector) Giai đoạn 2: Triển khai nhận diện phân tích (Apply Face Mask Detector) BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB 3.2 Phân tích chi tiết luồng hoạt động hệ thống 3.2.1 Giai đoạn huấn luyện liệu cho hệ thống Hình 5-Sơ đồ luồng hoạt động giai đoạn Train liệu Chúng ta tập trung vào việc tải tập liệu phát trang từ liệu, đào tạo mơ hình (sử dụng Keras / TensorFlow) tập liệu sau hóa trình phát trang vào liệu Phân tích luồng hoạt động giai đoạn Train liệu qua thứ tự bước: - Load face mask dataset: bước đầu tiên, hệ thống bắt đầu load liệu để liệu đưa vào, liệu lấy từ tập liệu (dataset) - Train face mask classifier with Keras/Tensorflow: tiến hành huấn luyện phân loại với Keras/Tensoflow, việc huấn luyện lúc có nhiệm vụ phân loại khn mặt có đeo trang không đao trang để việc phân tích đưa hai kết cho việc nhận diện - Serialize face mask classifier to disk: hóa việc phân loại với Keras/Tensorflow, lúc hệ thống có nhiệm vụ liên tục thực việc train liệu đầu vào để trì việc huấn luyện liệu BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB 3.2.2 Giai đoạn áp dụng triển khai phân tích nhận diện hệ thống Hình 6-Sơ đồ luồng hoạt động phân tích nhận diện hệ thống Sau trình phát trang huấn luyện (train), chuyển sang tải trình phát trang, thực phát khn mặt sau phân loại khn mặt thành có đeo trang khơng đeo trang Phân tích luồng hoạt động giai đoạn áp dụng vào phân tích nhận diện hệ thống: - Load face mask classifier from disk: Trước phân tích, cho hệ thống load qua tồn ảnh nhận dạng nhớ cho chúng học sau tiền hành sang cho việc nhận diện phân tích - Detect face in video stream: sau load toàn ảnh từ ảnh ta chuyện sang nhận diện khuôn mặt thông qua video stream sử dụng webcam từ laptop BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB - Extract each face ROI: sau nhận dạng khuôn mặt từ video stream ta tiến hành áp dụng ROI vào việc trích xuất khuôn mặt tập trung định - Apply face mask classifier to each face ROI to determine "mask" or "no mask": Áp dụng công cụ phân loại trang cho ROI khuôn mặt để xác định "có trang" "khơng có trang" - Show results: hiển thị kết sau tiến hành phân tích nhận diện 3.3 Phân tích tập liệu (dataset) 3.3.1 Xây dựng tập liệu Để xây dựng tập liệu phục vụ cho việc huấn luyện (train) liệu Tập ảnh chân dung với khuôn mặt không đeo trang (without mask): tạo kho ảnh chụp chân dung nhiều người khác nhau, sau training tập với định danhh khơng đeo trang Tập ảnh chân dung với khuôn mặt đeo trang (with mask): sử dụng tập ảnh chân dung không đeo trang, ta tiến hành tạo tâp ảnh nhân tạo cách dùng tập lệnh Python sử dụng OpenCV cho việc ghép hình trang vào khn mặt khơng đeo trang Từ ta có tập liệu ảnh nhân tạo áp dụng thực tế Các mốc khuôn mặt cho phép suy xác định cấu trúc khuôn mặt, bao gồm: Đôi mắt, Lông mày, Mũi, Mặt, Khuôn hàm mặt Để sử dụng mốc khuôn mặt để xây dựng tập liệu khuôn mặt đeo trang, trước tiên cần bắt đầu hình ảnh người khơng đeo trang: BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Hình 7-Bức ảnh người không đeo trang BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Để xây dựng liệu trang phòng đại dịch COVID-19 / Coronavirus, trước tiên bắt đầu với ảnh người không đeo trang Từ đó, áp dụng tính phát khn mặt để tính tốn vị trí hộp giới hạn khn mặt hình ảnh: Hình 8-Nhận diện khn mặt ảnh nhờ Deep Learning Hình 3.3.2 - Áp dụng tính nzăng nhận diện khn mặt Ở đây, sử dụng phương pháp học sâu (Deep Learning) để thực nhận diện khuôn mặt với OpenCV BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Hình 9-Trích xuất ROI khn mặt với OpenCV NumPy cắt Hình 3.3.3 - Khi biết vị trí khn mặt hình ảnh, trích xuất Vùng ưa thích (ROI) khn mặt Và từ đó, áp dụng điểm mốc khuôn mặt, cho phép xác định vị trí mắt, mũi, miệng, v.v.: Hình 10-Đánh dấu điểm mốc khn mặt Sau đó, phát điểm mốc khuôn mặt cách sử dụng dlib để biết vị trí đặt trang khn mặt BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Tiếp theo, cần hình ảnh trang (với suốt) hình bên dưới: Hình 11-Hình trang Hình 3.3.5- Ví dụ trang ngăn chặn lây lan COVID-19 Coronavirus qua đường hô hấp Khẩu trang tự động phủ lên ROI khn mặt ban đầu biết vị trí mốc khn mặt Khẩu trang tự động áp dụng cho khuôn mặt cách sử dụng điểm mốc khuôn mặt (cụ thể điểm dọc theo cằm mũi) để tính tốn vị trí trang đặt Hình 12-Hình ảnh trang đặt lên khn mặt Trong hình này, trang đặt khuôn mặt người khung hình ban đầu Nhìn thống qua, khó biết trang COVID-19 áp dụng với thị giác máy tính thơng qua mốc khn mặt OpenCV dlib Sau đó, lặp lại trình cho tất hình ảnh đầu vào mình, từ tạo liệu trang nhân tạo chúng ta: BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Hình 13-Bộ liệu ảnh đeo trang nhân tạo Hình 3.3.7- Hình ảnh trang COVID-19 nhân tạo hiển thị Bộ phần liệu "có trang" / "khơng có trang" để phát trang COVID-19 với thị giác máy tính học sâu Python, OpenCV TensorFlow / Keras BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Chương 4: Triển khai xây dựng 4.1 Cấu trúc dự án Cấu trúc thư mục dự án: ├── dataset │ ├── with_mask [690 entries] │ └── without_mask [686 entries] ├── examples │ ├── example_01.png │ ├── example_02.png │ └── example_03.png ├── face_detector │ ├── deploy.prototxt │ └── res10_300x300_ssd_iter_140000.caffemodel ├── detect_mask_image.py ├── detect_mask_video.py ├── mask_detector.model ├── plot.png └── train_mask_detector.py Tập thư mục dataset chứa liệu mô tả phần “Tập liệu phát trang COVID-19 chúng ta” Ba hình ảnh examples cung cấp để bạn kiểm tra trình phát trang hình ảnh tĩnh - train_mask_detector.py : Chấp nhận tập liệu đầu vào tinh chỉnh MobileNetV2 dựa để tạo mask_detector.model Một plot.png lịch sử huấn luyện tạo - detect_mask_image.py : Thực phát trang hình ảnh tĩnh - detect_mask_video.py : Sử dụng webcam bạn, tập lệnh áp dụng tính phát trang cho khung hình luồng 4.2 Triển khai kịch huấn luyện (training) hệ thống nhận diện trang Chúng ta tiến hành xem xét tập liệu, tìm hiểu cách để sử dụng Keras TensorFlow để đào tạo phân loại nhằm tự động phát người có đeo trang hay khơng BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Để hồn thành nhiệm vụ này, tinh chỉnh kiến trúc MobileNet V2, kiến trúc hiệu cao áp dụng cho thiết bị nhúng có dung lượng tính tốn hạn chế (ví dụ: Raspberry Pi, Google Coral, NVIDIA Jetson Nano, v.v.) Việc triển khai nhận diện trang cho thiết bị nhúng giảm chi phí sản xuất hệ thống phát trang vậy, lí chọn sử dụng kiến trúc Hình 14-Kết nhận diện khn mặt khơng mang trang Hình 4.4 – Kết nhận diện khn mặt không đeo trang sau phân tích Hình 15-Kết nhận diện khn mặt có đeo trang BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Hình 4.4.1 – Kết nhận diện khuôn mặt đeo trang sau phân tích Ở đây, Ta thấy máy dị trang có khả chạy thời gian thực (và xác dự đốn nó) BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB Chương 5: Kết luận hướng phát triển 5.1 Kết luận Sau thời gian khoảng tháng vừa học vừa triển khai xây dựng cuối hệ thống hồn thành Hệ thống load training liệu từ tập liệu tạo gồm ảnh người có đeo trang khơng đeo trang Từ phân tích nhận diện phân biệt khn mặt có đeo trang khơng Ngồi nhận diện theo thời gian thực người dùng sử dụng webcam stream Tuy nhiên thời gian kiến thức có hạn,nhóm em hồn thành hệ thống nên cịn vài hạn chế định sau: - Hệ thống nhận diện hoạt động ánh sáng yếu, khoảng cách xa - Vì tập liệu nhân tạo nên đơi có sai sót nhầm lẫn nhận diện loại trang kiểu mẫu khác - Chưa thể đưa cảnh báo âm 5.2 Hướng phát triển Vì hệ thống cịn số hạn chế nên nhóm em tiếp tục cải thiện hệ thống mặt nhận diện Sưu tập ảnh liệu thật để nâng cao khả nhận diện đưa kết xác Bổ sung tính cho phép hệ thống đưa cảnh báo âm Xây dựng lắp đặt camera giám sát tích hợp việc nhận diện khn mặt mang trang BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB BAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLABBAI.tap.lon.de.tai.xu.ly.ANH.BANG.MATLAB

Ngày đăng: 23/12/2023, 20:45

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

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

Tài liệu liên quan