使用OpenCV入门计算机视觉实战指南

5星 · 超过95%的资源 需积分: 10 86 下载量 143 浏览量 更新于2024-07-22 收藏 12.95MB PDF 举报
"a practical introduction to computer vision with opencv pdf" 《实用计算机视觉入门:使用OpenCV》是由Kenneth Dawson-Howe编著的一本专著,主要针对希望学习计算机视觉基础知识和OpenCV库的读者。这本书是作者在 Trinity College Dublin 的研究成果之一,于2014年由John Wiley & Sons Ltd首次出版。 计算机视觉是一门多领域交叉学科,它涉及图像处理、机器学习和人工智能等多个方面,旨在使计算机能够理解和解释图像或视频数据。OpenCV(Open Source Computer Vision Library)是一个强大的开源库,提供了许多用于图像处理和计算机视觉任务的函数和模块。 本书的核心内容可能包括以下几个关键知识点: 1. 基础概念:书中可能会介绍图像的基本概念,如像素、颜色空间(如RGB和灰度)、图像的表示和存储,以及基本的图像操作,如平移、旋转、缩放等。 2. 图像处理:涵盖滤波技术,包括高斯滤波、中值滤波、边缘检测(如Canny、Sobel和Hough变换)等,以及形态学操作,如腐蚀、膨胀和开闭运算。 3. 特征检测与匹配:介绍如何在图像中识别和提取关键点(如SIFT、SURF、ORB),以及如何进行特征匹配,这对于图像拼接、目标跟踪和三维重建等应用至关重要。 4. 物体识别与分类:通过机器学习算法(如支持向量机SVM、决策树或神经网络)训练模型来识别和分类物体。可能会讲解如何准备训练数据,以及如何使用OpenCV实现这些算法。 5. 视频分析:讨论帧间处理技术,如光流估计、运动分析和视频稳定,这些都是实时监控、运动检测等应用的基础。 6. 深度学习与OpenCV:近年来,深度学习在计算机视觉中的应用越来越广泛,书中可能涵盖了如何使用OpenCV与深度学习框架(如TensorFlow或PyTorch)集成,进行卷积神经网络(CNN)和其它深度模型的训练与部署。 7. 实践项目:书中可能包含一系列实际项目,让读者将所学应用于解决真实世界问题,如人脸识别、二维码读取、自动驾驶辅助系统等。 通过这本《实用计算机视觉入门:使用OpenCV》,读者可以系统地学习计算机视觉理论,并掌握OpenCV的实际应用技巧,为从事相关领域的研究或开发工作打下坚实基础。同时,书中的实例和练习有助于巩固知识,提升读者的动手能力。
2015-06-26 上传
Contents Preface xiii 1 Introduction 1 1.1 A Difficult Problem 1 1.2 The Human Vision System 2 1.3 Practical Applications of Computer Vision 3 1.4 The Future of Computer Vision 5 1.5 Material in This Textbook 6 1.6 Going Further with Computer Vision 7 2 Images 9 2.1 Cameras 9 2.1.1 The Simple Pinhole Camera Model 9 2.2 Images 10 2.2.1 Sampling 11 2.2.2 Quantisation 11 2.3 Colour Images 13 2.3.1 Red–Green–Blue (RGB) Images 14 2.3.2 Cyan–Magenta–Yellow (CMY) Images 17 2.3.3 YUV Images 17 2.3.4 Hue Luminance Saturation (HLS) Images 18 2.3.5 Other Colour Spaces 20 2.3.6 Some Colour Applications 20 2.4 Noise 22 2.4.1 Types of Noise 23 2.4.2 Noise Models 25 2.4.3 Noise Generation 26 2.4.4 Noise Evaluation 26 2.5 Smoothing 27 2.5.1 Image Averaging 27 2.5.2 Local Averaging and Gaussian Smoothing 28 2.5.3 Rotating Mask 30 2.5.4 Median Filter 31 3 Histograms 35 3.1 1D Histograms 35 3.1.1 Histogram Smoothing 36 3.1.2 Colour Histograms 37 3.2 3D Histograms 39 3.3 Histogram/Image Equalisation 40 3.4 Histogram Comparison 41 3.5 Back-projection 43 3.6 k-means Clustering 44 4 Binary Vision 49 4.1 Thresholding 49 4.1.1 Thresholding Problems 50 4.2 Threshold Detection Methods 51 4.2.1 Bimodal Histogram Analysis 52 4.2.2 Optimal Thresholding 52 4.2.3 Otsu Thresholding 54 4.3 Variations on Thresholding 56 4.3.1 Adaptive Thresholding 56 4.3.2 Band Thresholding 57 4.3.3 Semi-thresholding 58 4.3.4 Multispectral Thresholding 58 4.4 Mathematical Morphology 59 4.4.1 Dilation 60 4.4.2 Erosion 62 4.4.3 Opening and Closing 63 4.4.4 Grey-scale and Colour Morphology 65 4.5 Connectivity 66 4.5.1 Connectedness: Paradoxes and Solutions 66 4.5.2 Connected Components Analysis 67 5 Geometric Transformations 71 5.1 Problem Specification and Algorithm 71 5.2 Affine Transformations 73 5.2.1 Known Affine Transformations 74 5.2.2 Unknown Affine Transformations 75 5.3 Perspective Transformations 76 5.4 Specification of More Complex Transformations 78 5.5 Interpolation 78 5.5.1 Nearest Neighbour Interpolation 79 5.5.2 Bilinear Interpolation 79 5.5.3 Bi-Cubic Interpolation 80 5.6 Modelling and Removing Distortion from Cameras 80 5.6.1 Camera Distortions 81 5.6.2 Camera Calibration and Removing Distortion 82 6 Edges 83 6.1 Edge Detection 83 6.1.1 First Derivative Edge Detectors 85 6.1.2 Second Derivative Edge Detectors 92 6.1.3 Multispectral Edge Detection 97 6.1.4 Image Sharpening 98 6.2 Contour Segmentation 99 6.2.1 Basic Representations of Edge Data 99 6.2.2 Border Detection 102 6.2.3 Extracting Line Segment Representations of Edge Contours 105 6.3 Hough Transform 108 6.3.1 Hough for Lines 109 6.3.2 Hough for Circles 111 6.3.3 Generalised Hough 112 7 Features 115 7.1 Moravec Corner Detection 117 7.2 Harris Corner Detection 118 7.3 FAST Corner Detection 121 7.4 SIFT 122 7.4.1 Scale Space Extrema Detection 123 7.4.2 Accurate Keypoint Location 124 7.4.3 Keypoint Orientation Assignment 126 7.4.4 Keypoint Descriptor 127 7.4.5 Matching Keypoints 127 7.4.6 Recognition 127 7.5 Other Detectors 129 7.5.1 Minimum Eigenvalues 130 7.5.2 SURF 130 8 Recognition 131 8.1 Template Matching 131 8.1.1 Applications 131 8.1.2 Template Matching Algorithm 133 8.1.3 Matching Metrics 134 8.1.4 Finding Local Maxima or Minima 135 8.1.5 Control Strategies for Matching 137 8.2 Chamfer Matching 137 8.2.1 Chamfering Algorithm 137 8.2.2 Chamfer Matching Algorithm 139 8.3 Statistical Pattern Recognition 140 8.3.1 Probability Review 142 8.3.2 Sample Features 143 8.3.3 Statistical Pattern Recognition Technique 149 8.4 Cascade of Haar Classifiers 152 8.4.1 Features 154 8.4.2 Training 156 8.4.3 Classifiers 156 8.4.4 Recognition 158 8.5 Other Recognition Techniques 158 8.5.1 Support Vector Machines (SVM) 158 8.5.2 Histogram of Oriented Gradients (HoG) 159 8.6 Performance 160 8.6.1 Image and Video Datasets 160 8.6.2 Ground Truth 161 8.6.3 Metrics for Assessing Classification Performance 162 8.6.4 Improving Computation Time 165 9 Video 167 9.1 Moving Object Detection 167 9.1.1 Object of Interest 168 9.1.2 Common Problems 168 9.1.3 Difference Images 169 9.1.4 Background Models 171 9.1.5 Shadow Detection 179 9.2 Tracking 180 9.2.1 Exhaustive Search 181 9.2.2 Mean Shift 181 9.2.3 Dense Optical Flow 182 9.2.4 Feature Based Optical Flow 185 9.3 Performance 186 9.3.1 Video Datasets (and Formats) 186 9.3.2 Metrics for Assessing Video Tracking Performance 187 10 Vision Problems 189 10.1 Baby Food 189 10.2 Labels on Glue 190 10.3 O-rings 191 10.4 Staying in Lane 192 10.5 Reading Notices 193 10.6 Mailboxes 194 10.7 Abandoned and Removed Object Detection 195 10.8 Surveillance 196 10.9 Traffic Lights 197 10.10 Real Time Face Tracking 198 10.11 Playing Pool 199 10.12 Open Windows 200 10.13 Modelling Doors 201 10.14 Determining the Time from Analogue Clocks 202 10.15 Which Page 203 10.16 Nut/Bolt/Washer Classification 204 10.17 Road Sign Recognition 205 10.18 License Plates 206 10.19 Counting Bicycles 207 10.20 Recognise Paintings 208 References 209 Index 213