Easy Introduction to OpenCV: Python-Oriented (2nd Edition) cover

Easy Introduction to OpenCV: Python-Oriented (2nd Edition)

Rating 4.1
Word count
259K words
Chapters
292
ISBN
9787121455995

Tags

Summary

This book, based on OpenCV for Python, introduces various aspects of image processing. It follows the knowledge structure of the official OpenCV documentation as its main thread and supplements and explains the details. The book not only introduces how to use OpenCV functions but also explains the algorithm principles behind their implementation. When introducing how to use OpenCV functions, it provides a large number of program examples. Moreover, before introducing how a function processes images, it often first demonstrates how the function processes numerical values and arrays, making it easier for readers to observe and understand the processing procedure and results from a numerical perspective. When introducing specific algorithm principles, the book uses plain language and examples close to everyday life whenever possible, avoiding excessive complex and abstract formulas.

Editor's review

This is an introductory book on OpenCV image processing for Python, organized around the knowledge structure of the official documentation, and the second edition continues the “examples first, principles second” approach. Its standout feature is that it covers both function usage and algorithm explanation: when introducing processing functions, it provides numerous program examples and often first shows the processing from the perspective of numerical values and arrays, allowing readers to intuitively see how image data is changed; when explaining algorithm principles, it uses plain language and everyday examples as much as possible to reduce the reading barrier caused by complex formulas. For readers who want hands-on image processing without being blocked by abstract theory, this book helps build a transition from calling functions to understanding the logic behind them. It is suitable for reading chapter by chapter while typing the code, using the examples as starting points for practice and then gradually replacing them with your own images and parameters for verification.

Who it's for

A good fit for

  • Developers with Python basics who want a systematic introduction to OpenCV image processing
  • Students in computer vision-related courses who need to complete exercises alongside experiments
  • Engineers who need to quickly implement image reading, transformation, and basic processing at work
  • Self-learners who want to understand image processing algorithm principles through examples and intuitive explanations

Not a good fit for

  • Readers with no Python programming experience who need to first build a syntax foundation
  • Readers who want to study deep learning model training and deployment in depth
  • Academic readers looking for purely mathematical derivations of algorithms or reviews of cutting-edge research

Reading tips

  1. Read in chapter order and run the example code simultaneously; first observe changes in array values, then understand the overall effect of functions on images.
  2. After learning each category of functions, replace the example materials with your own images and modify parameters to observe differences, deepening your understanding of the processing procedure.
  3. When reading the algorithm principle sections, first use everyday examples to build intuition, then review the key steps in the code, avoiding getting bogged down in formula details.
  4. It is recommended to keep your own code notes, categorized by topics such as image reading, transformation, filtering, and features, for later reference and reuse.

About the publisher

Publishing House of Electronics Industry China · Founded in 1982

The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.

Contents

  1. 版权信息
  2. 内容简介
  3. 第2版前言
  4. 前言
  5. 第1章 OpenCV入门
  6. 1.1 如何使用
  7. 1.2 图像处理基本操作
  8. 1.2.1 读取图像
  9. 1.2.2 显示图像
  10. 1.2.3 保存图像
  11. 1.3 OpenCV贡献库
  12. 第2章 图像处理基础
  13. 2.1 图像的基本表示方法
  14. 2.2 像素处理
  15. 2.3 使用numpy.array访问像素
  16. 2.4 感兴趣区域(ROI)
  17. 2.5 通道操作
  18. 2.5.1 通道拆分
  19. 2.5.2 通道合并
  20. 2.6 获取图像属性
  21. 第3章 图像运算
  22. 3.1 图像加法运算
  23. 3.1.1 加号运算符
  24. 3.1.2 cv2.add()函数
  25. 3.2 图像加权和
  26. 3.3 按位逻辑运算
  27. 3.3.1 按位与运算
  28. 3.3.2 按位或运算
  29. 3.3.3 按位非运算
  30. 3.3.4 按位异或运算
  31. 3.4 掩膜
  32. 3.5 图像与数值的运算
  33. 3.6 位平面分解
  34. 3.7 图像加密和解密
  35. 3.8 数字水印
  36. 3.8.1 原理
  37. 3.8.2 实现方法
  38. 3.8.3 例题
  39. 3.9 脸部打码及解码
  40. 3.9.1 按位与方式
  41. 3.9.2 ROI方式
  42. 第4章 色彩空间类型转换
  43. 4.1 色彩空间基础
  44. 4.1.1 GRAY色彩空间
  45. 4.1.2 XYZ色彩空间
  46. 4.1.3 YCrCb色彩空间
  47. 4.1.4 HSV色彩空间
  48. 4.1.5 HLS色彩空间
  49. 4.1.6 CIEL*a*b*色彩空间
  50. 4.1.7 CIEL*u*v*色彩空间
  51. 4.1.8 Bayer色彩空间
  52. 4.2 类型转换函数
  53. 4.3 类型转换实例
  54. 4.3.1 通过数组观察转换效果
  55. 4.3.2 图像处理实例
  56. 4.4 HSV色彩空间讨论
  57. 4.4.1 基础知识
  58. 4.4.2 获取指定颜色
  59. 4.4.3 标记指定颜色
  60. 4.4.4 标记肤色
  61. 4.4.5 实现艺术效果
  62. 4.5 alpha通道
  63. 第5章 几何变换
  64. 5.1 缩放
  65. 5.2 翻转
  66. 5.3 仿射
  67. 5.3.1 平移
  68. 5.3.2 旋转
  69. 5.3.3 更复杂的仿射变换
  70. 5.4 透视
  71. 5.5 重映射
  72. 5.5.1 映射参数的理解
  73. 5.5.2 复制
  74. 5.5.3 绕x轴翻转
  75. 5.5.4 绕y轴翻转
  76. 5.5.5 绕x轴、y轴翻转
  77. 5.5.6 x轴、y轴互换
  78. 5.5.7 图像缩放
  79. 第6章 阈值处理
  80. 6.1 threshold函数
  81. 6.1.1 二值化阈值处理(cv2.THRESH_BINARY)
  82. 6.1.2 反二值化阈值处理(cv2.THRESH_BINARY_INV)
  83. 6.1.3 截断阈值化处理(cv2.THRESH_TRUNC)
  84. 6.1.4 超阈值零处理(cv2.THRESH_TOZERO_INV)
  85. 6.1.5 低阈值零处理(cv2.THRESH_TOZERO)
  86. 6.2 Otsu处理
  87. 6.3 自适应阈值处理
  88. 第7章 图像平滑处理
  89. 7.1 均值滤波
  90. 7.1.1 基本原理
  91. 7.1.2 函数语法
  92. 7.1.3 程序示例
  93. 7.2 方框滤波
  94. 7.2.1 基本原理
  95. 7.2.2 函数语法
  96. 7.2.3 程序示例
  97. 7.3 高斯滤波
  98. 7.3.1 基本原理
  99. 7.3.2 函数语法
  100. 7.3.3 程序示例
  101. 7.4 中值滤波
  102. 7.4.1 基本原理
  103. 7.4.2 函数语法
  104. 7.4.3 程序示例
  105. 7.5 双边滤波
  106. 7.5.1 基本原理
  107. 7.5.2 函数语法
  108. 7.5.3 程序示例
  109. 7.6 2D卷积
  110. 第8章 形态学操作
  111. 8.1 腐蚀
  112. 8.2 膨胀
  113. 8.3 通用形态学函数
  114. 8.4 开运算
  115. 8.5 闭运算
  116. 8.6 形态学梯度运算
  117. 8.7 礼帽运算
  118. 8.8 黑帽运算
  119. 8.9 核函数
  120. 第9章 图像梯度
  121. 9.1 卷积基础
  122. 9.2 Sobel理论基础
  123. 9.3 Sobel算子及函数使用
  124. 9.3.1 参数ddepth
  125. 9.3.2 方向
  126. 9.3.3 实例
  127. 9.4 Scharr算子及函数使用
  128. 9.5 Sobel算子和Scharr算子的比较
  129. 9.6 Laplacian算子及函数使用
  130. 9.7 算子总结
  131. 第10章 Canny边缘检测
  132. 10.1 Canny边缘检测基础
  133. 10.2 Canny函数及使用
  134. 第11章 图像金字塔
  135. 11.1 理论基础
  136. 11.2 pyrDown函数及使用
  137. 11.3 pyrUp函数及使用
  138. 11.4 采样可逆性的研究
  139. 11.5 拉普拉斯金字塔
  140. 11.5.1 定义
  141. 11.5.2 应用
  142. 第12章 图像轮廓
  143. 12.1 查找并绘制轮廓
  144. 12.1.1 查找图像轮廓:findContours函数
  145. 12.1.2 绘制图像轮廓:drawContours函数
  146. 12.1.3 轮廓实例
  147. 12.2 矩特征
  148. 12.2.1 矩的计算:moments函数
  149. 12.2.2 计算轮廓的面积:contourArea函数
  150. 12.2.3 计算轮廓的长度:arcLength函数
  151. 12.3 Hu矩
  152. 12.3.1 Hu矩函数
  153. 12.3.2 形状匹配
  154. 12.4 轮廓拟合
  155. 12.4.1 矩形包围框
  156. 12.4.2 最小包围矩形框
  157. 12.4.3 最小包围圆形
  158. 12.4.4 最优拟合椭圆
  159. 12.4.5 最优拟合直线
  160. 12.4.6 最小外包三角形
  161. 12.4.7 逼近多边形
  162. 12.5 凸包
  163. 12.5.1 获取凸包
  164. 12.5.2 凸缺陷
  165. 12.5.3 几何学测试
  166. 12.6 利用形状场景算法比较轮廓
  167. 12.6.1 计算形状场景距离
  168. 12.6.2 计算Hausdorff距离
  169. 12.7 轮廓的特征值
  170. 12.7.1 宽高比
  171. 12.7.2 Extent
  172. 12.7.3 Solidity
  173. 12.7.4 等效直径(Equivalent Diameter)
  174. 12.7.5 方向
  175. 12.7.6 掩膜和像素点
  176. 12.7.7 最大值和最小值及它们的位置
  177. 12.7.8 平均颜色及平均灰度
  178. 12.7.9 极点
  179. 第13章 直方图处理
  180. 13.1 直方图的含义
  181. 13.2 绘制直方图
  182. 13.2.1 使用Numpy绘制直方图
  183. 13.2.2 使用OpenCV绘制直方图
  184. 13.2.3 使用掩膜绘制直方图
  185. 13.3 直方图均衡化
  186. 13.3.1 直方图均衡化原理
  187. 13.3.2 直方图均衡化处理
  188. 13.4 pyplot模块介绍
  189. 13.4.1 subplot函数
  190. 13.4.2 imshow函数
  191. 第14章 傅里叶变换
  192. 14.1 理论基础
  193. 14.2 Numpy实现傅里叶变换
  194. 14.2.1 实现傅里叶变换
  195. 14.2.2 实现逆傅里叶变换
  196. 14.3 OpenCV实现傅里叶变换
  197. 14.3.1 实现傅里叶变换
  198. 14.3.2 实现逆傅里叶变换
  199. 14.4 滤波处理
  200. 14.4.1 滤波原理
  201. 14.4.2 高通滤波实现
  202. 14.4.3 低通滤波实现
  203. 第15章 模板匹配
  204. 15.1 模板匹配基础
  205. 15.2 多模板匹配
  206. 第16章 霍夫变换
  207. 16.1 霍夫直线变换
  208. 16.1.1 霍夫变换原理
  209. 16.1.2 HoughLines函数
  210. 16.1.3 HoughLinesP函数
  211. 16.2 霍夫圆环变换
  212. 第17章 图像分割与提取
  213. 17.1 用分水岭算法实现图像分割与提取
  214. 17.1.1 算法原理
  215. 17.1.2 相关函数介绍
  216. 17.1.3 分水岭算法图像分割实例
  217. 17.2 交互式前景提取
  218. 17.2.1 矩形框提取
  219. 17.2.2 自定义模板提取
  220. 17.2.3 手绘模板提取
  221. 第18章 视频处理
  222. 18.1 VideoCapture类
  223. 18.1.1 类函数介绍
  224. 18.1.2 捕获摄像头视频
  225. 18.1.3 播放视频文件
  226. 18.2 VideoWriter类
  227. 18.2.1 类函数介绍
  228. 18.2.2 保存视频
  229. 18.3 视频操作基础
  230. 第19章 绘图及交互
  231. 19.1 绘画基础
  232. 19.1.1 绘制直线
  233. 19.1.2 绘制矩形
  234. 19.1.3 绘制圆形
  235. 19.1.4 绘制椭圆
  236. 19.1.5 绘制多边形
  237. 19.1.6 在图形上绘制文字
  238. 19.2 鼠标交互
  239. 19.2.1 绘制随机矩形
  240. 19.2.2 双窗口绘制图形
  241. 19.2.3 绘制多种不同图形
  242. 19.3 滚动条
  243. 19.3.1 用滚动条实现调色板
  244. 19.3.2 滚动条交互
  245. 19.3.3 用滚动条作为开关
  246. 第20章 K近邻算法
  247. 20.1 理论基础
  248. 20.2 计算
  249. 20.2.1 归一化
  250. 20.2.2 距离计算
  251. 20.3 手写数字识别的原理
  252. 20.4 自定义函数手写数字识别
  253. 20.5 K近邻模块的基本使用
  254. 20.6 K近邻手写数字识别
  255. 第21章 支持向量机
  256. 21.1 理论基础
  257. 21.2 SVM流程
  258. 21.3 SVM员工表现预测
  259. 21.4 手写数字识别
  260. 第22章 K均值聚类
  261. 22.1 理论基础
  262. 22.1.1 分豆子
  263. 22.1.2 K均值聚类的基本步骤
  264. 22.2 K均值聚类模块
  265. 22.3 单特征豆子分类
  266. 22.4 米粒分类
  267. 22.5 灰度图像二值化
  268. 第23章 人脸识别
  269. 23.1 人脸检测
  270. 23.1.1 基本原理
  271. 23.1.2 级联分类器的使用
  272. 23.1.3 函数介绍
  273. 23.1.4 案例介绍
  274. 23.2 人脸识别基础
  275. 23.2.1 人脸识别基本流程
  276. 23.2.2 OpenCV人脸识别基础
  277. 23.3 LPBH人脸识别
  278. 23.3.1 基本原理
  279. 23.3.2 函数介绍
  280. 23.3.3 案例介绍
  281. 23.4 EigenFaces人脸识别
  282. 23.4.1 基本原理
  283. 23.4.2 函数介绍
  284. 23.4.3 案例介绍
  285. 23.5 Fisherfaces人脸识别
  286. 23.5.1 基本原理
  287. 23.5.2 函数介绍
  288. 23.5.3 案例介绍
  289. 23.6 人脸数据库
  290. 附录A 范例
  291. 附录B 练习题
  292. 附录C 参考答案

FAQ

What background is needed before studying this book?
You need basic Python syntax and the ability to use common data structures; familiarity with arrays will make things smoother. The book explains image processing from the perspective of numerical values and arrays, so readers who are comfortable with lists and array operations will get started faster. No prior image processing experience is required, but if you have no programming foundation at all, it is advisable to learn Python first.
What runtime environment is needed for the example code in the book?
The book uses OpenCV for Python, so readers need a Python environment that can run code and must install the relevant OpenCV libraries. For specific versions and installation methods, refer to the book's instructions and the official documentation. The examples usually require image files to run; it is recommended to create separate directories by chapter to manage materials and code.
Can this book be used for computer vision projects?
This book focuses on the fundamental functions and algorithm principles of image processing and is suitable as introductory preparation for computer vision projects. It can help you master common operations such as image reading, transformation, and filtering, but if the project involves advanced tasks such as deep learning model training or object detection, you will need to study additional frameworks and algorithm materials.

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

李立宗 Author

Li Lizong is an author about whom limited public information is available. Only his name and two works are known, while details such as nationality, English name, and dates of birth and death remain unconfirmed. Judging from the works in the library, his writing centers on computer vision and OpenCV technology, covering a Python-oriented introductory tutorial as well as a case collection that ranges from beginner level to deep learning. This suggests that his content balances foundational introduction with practical application, making it suitable for readers who wish to learn image processing and computer vision with OpenCV-Python. His works are categorized in the library under computer science and software learning, and they generally emphasize hands-on use of technical tools, with a tutorial style that is likely to progress step by step. Because there is no public biographical information, no further inferences are made here; the description of his writing focus is based only on the subject matter and categorization of his works.

More by the same author

Top rated in the same category