Practical Python and OpenCV

Content

1 introduction 1
2 python and required packages 5
2.1 NumPy and SciPy . . . . . . . . . . . . . . . . 6
2.1.1 Windows . . . . . . . . . . . . . . . . . 7
2.1.2 OSX . . . . . . . . . . . . . . . . . . . 7
2.1.3 Linux . . . . . . . . . . . . . . . . . . . 7
2.2 Matplotlib . . . . . . . . . . . . . . . . . . . . 8
2.2.1 All Platforms . . . . . . . . . . . . . . 8
2.3 OpenCV . . . . . . . . . . . . . . . . . . . . . . 8
2.3.1 Linux and OSX . . . . . . . . . . . . . 9
2.3.2 Windows . . . . . . . . . . . . . . . . . 10
2.4 Mahotas . . . . . . . . . . . . . . . . . . . . . . 10
2.4.1 All Platforms . . . . . . . . . . . . . . 11
2.5 scikit-learn . . . . . . . . . . . . . . . . . . . . 11
2.5.1 All Platforms . . . . . . . . . . . . . . 11
2.6 scikit-image . . . . . . . . . . . . . . . . . . . . 12
2.7 Skip the Installation . . . . . . . . . . . . . . . 12
3 loading, displaying, and saving 14
4 image basics 19
4.1 So, What’s a Pixel? . . . . . . . . . . . . . . . 19
4.2 Overview of the Coordinate System . . . . . 22
4.3 Accessing and Manipulating Pixels . . . . . . 22
5 drawing 31
5.1 Lines and Rectangles . . . . . . . . . . . . . . 31
5.2 Circles . . . . . . . . . . . . . . . . . . . . . . 36
6 image processing 41
6.1 Image Transformations . . . . . . . . . . . . . 41
6.1.1 Translation . . . . . . . . . . . . . . . . 42
6.1.2 Rotation . . . . . . . . . . . . . . . . . 47
6.1.3 Resizing . . . . . . . . . . . . . . . . . 52
6.1.4 Flipping . . . . . . . . . . . . . . . . . 58
6.1.5 Cropping . . . . . . . . . . . . . . . . 61
6.2 Image Arithmetic . . . . . . . . . . . . . . . . 63
6.3 Bitwise Operations . . . . . . . . . . . . . . . 70
6.4 Masking . . . . . . . . . . . . . . . . . . . . . 73
6.5 Splitting and Merging Channels . . . . . . . . 80
6.6 Color Spaces . . . . . . . . . . . . . . . . . . . 84
7 histograms 87
7.1 Using OpenCV to Compute Histograms . . . 88
7.2 Grayscale Histograms . . . . . . . . . . . . . . 89
7.3 Color Histograms . . . . . . . . . . . . . . . . 91
7.4 Histogram Equalization . . . . . . . . . . . . . 97
7.5 Histograms and Masks . . . . . . . . . . . . . 99
8 smoothing and blurring 105
8.1 Averaging . . . . . . . . . . . . . . . . . . . . . 107
8.2 Gaussian . . . . . . . . . . . . . . . . . . . . . 109
8.3 Median . . . . . . . . . . . . . . . . . . . . . . 110
8.4 Bilateral . . . . . . . . . . . . . . . . . . . . . . 113
9 thresholding 116
9.1 Simple Thresholding . . . . . . . . . . . . . . 116
9.2 Adaptive Thresholding . . . . . . . . . . . . . 120
9.3 Otsu and Riddler-Calvard . . . . . . . . . . . 124
10 gradients and edge detection 128
10.1 Laplacian and Sobel . . . . . . . . . . . . . . . 129
10.2 Canny Edge Detector . . . . . . . . . . . . . . 134
11 contours 137
11.1 Counting Coins . . . . . . . . . . . . . . . . . 137

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值