用Python学习OpenCV 3计算机视觉外文翻译资料

 2023-03-15 13:23:47

译文标题

关键词:OpenCV,Python,安装,配置

既然选择本书,就说明你可能对OpenCV有些了解。也许你看过科幻探险中的人脸 检测,并对此着迷。如果是这样,那本书将是你最佳的选择。OpenCV为Open Source Computer Vision的缩写,是一个免费的计算机视觉库,可通过处理图像和视频来完成各种 任务,包括显示摄像头输入的信号以及使机器人识别现实生活中的物体。

本书将介绍如何使用基于Python编程语言的OpenCV,这是一种很有潜力的方法。 Python是一种优雅的语言,学习起来相对容易,并且其功能非常强大。本章首先简单介 绍Python 2.7、OpenCV及其他相关库的安装,然后介绍OpenCV提供的Python示例脚 本和文档。

.标< 注意:如果想跳过安装过程直接使用,可从网站http://techfort.github.io/pycv/

W下载虚拟机(VM)。 、

该文件可在VirtualBox _h使用,VirtualBox是免费的虚拟化应用程序,允许人 们建立并运行虚拟机。该虚拟机基于Ubuntu Linux 14.04操作系统,并且已经 安装了所需要的软件,可在上面直接编程。

为了让该虚拟机运行流畅,至少需要2GB的内存,所以一定要确保分配至少 2GB (超过4GB会更好)的内存给虚拟机,这就意味着整个计算机至少需要 6GB内存才能运行流畅。

本章将介绍以下库的安装:

□ NumPy :这是OpenCV绑定Python时所依赖的库,它提供了数值计算函数,包括高

效的矩阵计算函数。

  • SciPy :该库是一个与NumPy密切相关的科学计算库。虽然OpenCV不需要该库, 但它在处理OpenCV的图像数据方面非常有用。
  • OpenNI :该库是OpenCV的一个可选依赖。它支持一些深度摄像头,如Asus的 XtionPROo
  • SensorKinect :该库是一个OpenNI插件,也是OpenCV的可选依赖。它支持微软的 Kinect深度摄像头。

專] 注意:由于除第4章外的其他章节或附录不会用到OpenNI和SensorKinect,

因此本书将它们作为可选库。

本书将重点介绍OpenCV 3,它是0penCV库最新发布的版本。关于OpenCV 的其他信息可查阅http://opencv.org,相关文档可在http://docs.opencv.org/ master上找到。

1.1选择和使用合适的安装工具

读者可根据所使用的操作系统和想要的配置来选择安装工具。下面介绍基于Windows. Mac、Ubuntu和其他类Unix系统下的工具安装。

1.1.1在Windows上安装

Windows并没有预装Python软件。下面的安装步骤适用于预编译好的Python、 NumPy、SciPy和OpenCVo另外,也可从源代码进行安装,这需要使用CMake来配置 OpenCV 的构建系统(build system),并用 Visual Studio 或 MinGW 编译。

如果想要支持深度摄像头(如Kinect),则应该先安装OpenNI和SensorKinect,这两个 库的预编译二进制文件都带有安装向导。然后必须从源代码来构建OpenCV。

或> 注意:OpenCV的预编译版本不支持深度摄像头。

在Windows系统中,OpenCV 2对32位Python的支持要比64位的好。但是,由于现 在大多数计算机都是64位系统,因此本书会针对64位系统进行介绍。提供64位Python 的网站也有32位版本的安装程序。

下面的一些步骤需要修改系统的PATH变量,这可以通过“控制面板”(Control Panel) 中的“环境变量'(Environment Variables)窗口完成。

  1. )在 Windows Vista / Windows 7/ Windows 8中,单击“开始”菜单,打开“控制面 板”,然后选择“系统”和“安全|系统|高级系统设置”,单击“环境变量hellip;”按钮。

2) 在Windows XP中,单击“开始”菜单,选择“控制面板|系统”,然后选择“高级” 选项卡,单击“环境变量hellip;”按钮。

3) 在“系统变量”中选择“路径”,然后单击“编辑”按钮。

4) 按规定进行修改。

5 )为了保存修改内容,可全部选择“确定”按钮(直到回到“控制面板”的主窗口)。

6)然后注销并重新登录(或者重新启动系统)。

1.使用二进制安装程序(不支持使用深度摄像头)

读者若愿意可以选择单独安装Python及其相关库;但在Python的发行版中附带了整个 SciPy栈(SciPy stack)(包括Python和NumPy)的安装程序,这使得安装开发环境变得非常 简单。

Anaconda Python 就是这样一个发行版(下载地址为:http://09c8d0b2229f813clb93c95a c804525aac4b6dba79b00b39d 1 d3.r79.cfl .rackcdn.com/Anaconda-2.1 .OWindows x86_64.exe) 0 安装该软件后,记得按前面的步骤将Anaconda的安装路径添加到PATH变量中。

下面是安装 Python 2.7、NumPy、SciPy 和 OpenCV 的步骤:

  1. )从 https://www.python.Org/ftp/python/2.7.9/python-2.7.9.amd64.msi 网站下载并安装 64 位 Python 2.7.9。
  2. )从 http://www.lfd.uci.edU/~gohlke/pythonlibs/#numpyhttp://sourcefbrge.net/projects/numpy/ files/NumPy/1.6.2/numpy-1.6.2-win32-superpackpython2.7.exe/download 网站下载并安装 NumPy 1.6.2 (注意,在64位Windows上安装NumPy会有点麻烦,因为64位的Fortran编 译器没有Windows版本,而NumPy库需要该编译器。上述链接是非官方的二进制版本)。
  3. )从 http://www.lfd.uci.edU/~gohlke/pythonlibs/#scipyhttp://sourcefbrge.net/projects/scipy/ files/scipy/0.11.0/scipy-0.11.0win32-superpack-python2.7.exe/download 网 站下载 并安装 SciPy 11.0 (ScriPy和NumPy 一样,都是社区(community)版的安装程序)。
  4. )在 https://github.com/Itseez/opencv 下载 OpenCV 3.0.0 的自解压 ZIP 文件。运行该 文件,会提示输入一个目标文件夹,本书称之为vunzip_destinationgt;,然后会建立一个子文 件夹,称为 lt;unzip_destinationgt;opencvD
  5. )复制 lt;unzip destinationgt;opencvuildpython2.7cv2.pyd 至lj C:Python2.7Libsite- packages (假设已经将Python 2.7安装到了默认文件夹)。如果安装Anaconda版本的Python 2.7,则会使用Anaconda安装程序所指定的文件夹,而不是Python安装时默认的文件夹。 现在,新安装的Python可以找到OpenCV 了。

6)如果想让默认安装的新Python运行脚本,需要修改系统变量PATH,将C: Python2.7 (假设已经在默认位置安装了 Python 2.7)或将Anaconda安装文件夹添加到该 变量中乙删除所有以前的Python路径,如:C:Python2.60注销并重新登录(或者重新启 动系统)O

2.使用CMake和编译器

Windows不附带任何编译器或CMake,因此需要安装。如果想要支持深度摄像头(比 如 Kinect),还需要安装 OpenNI 和 SensorKinect。

假设已经安装了 64位的Python 2.7、NumPy和SciPy,从二进制(像前面介绍的那样) 文件或从源代码进行安装都可以。现在可以安装编译器和CMake,选择性地安装OpenNI 和SensorKinect,然后从源代码编译0penCVo

  1. )在 http://www.cmake.Org/flles/V3.l/ cma

    剩余内容已隐藏,支付完成后下载完整资料


    Joe Minichino Joseph Howse

    C o m m u n i t y E x p e r i e n c e D i s t i l l e d

    Learning OpenCV 3 Computer Vision with Python

    Second Edition

    Unleash the power of computer vision with Python using OpenCV

    In this package, you will find:

    The author biography
    • A preview chapter from the book, Chapter 1 Setting Up OpenCV
    A synopsis of the bookrsquo;s content
    • More information on Learning OpenCV 3 Computer Vision with Python Second Edition

    About the Authors

    Joe Minichino is a computer vision engineer for Hoolux Medical by day and a developer of the NoSQL database LokiJS by night. On weekends, he is a heavy metal singer/songwriter. He is a passionate programmer who is immensely curious about programming languages and technologies and constantly experiments with them. At Hoolux, Joe leads the development of an Android computer vision-based advertising platform for the medical industry.

    Born and raised in Varese, Lombardy, Italy, and coming from a humanistic background in philosophy (at Milans Universitagrave; Statale), Joe has spent his last 11 years living in Cork, Ireland, which is where he became a computer science graduate at the Cork Institute of Technology.

    Joseph Howse lives in Canada. During the winters, he grows his beard, while his four cats grow their thick coats of fur. He loves combing his cats every day and sometimes, his cats also pull his beard.

    He has been writing for Packt Publishing since 2012. His books include OpenCV for Secret Agents, OpenCV Blueprints, Android Application Programming with OpenCV 3, OpenCV Computer Vision with Python, and Python Game Programming by Example.

    When he is not writing books or grooming his cats, he provides consulting, training, and software development services through his company, Nummist Media (http://nummist.com).

    Preface

    OpenCV 3 is a state-of-the-art computer vision library that is used for a variety of image and video processing operations. Some of the more spectacular and

    futuristic features, such as face recognition or object tracking, are easily achievable with OpenCV 3. Learning the basic concepts behind computer vision algorithms, models, and OpenCVs API will enable the development of all sorts of real-world applications, including security and surveillance tools.

    Starting with basic image processing operations, this book will take you through a journey that explores advanced computer vision concepts. Computer vision is a

    rapidly evolving science whose applications in the real world are exploding, so this book will appeal to computer vision novices as well as experts of the subject who want to learn about the brand new OpenCV 3.0.0.

    What this book covers

    Chapter 1, Setting Up OpenCV, explains how to set up OpenCV 3 with Python on different platforms. It will also troubleshoot common problems.

    Chapter 2, Handling Files, Cameras, and GUIs, introduces OpenCVs I/O functionalities. It will also discuss the concept of a project and the beginnings of an object-oriented design for this project.

    Chapter 3, Processing Images with OpenCV 3, presents some techniques required to alter images, such as detecting skin tone in an image, sharpening an image, marking contours of subjects, and detecting crosswalks using a line segment detector.

    Chapter 4, Depth Estimation and Segmentation, shows you how to use data from a depth camera to identify foreground and background regions, such that we can limit an effect to only the foreground or background.

    Preface

    Chapter 5, Detecting and Recognizing Faces, introduces some of OpenCVs face detection functionalities, along with the data files that define particular types of trackable objects.

    Chapter 6, Retrieving Images and Searching Using Image Descriptors, shows how to detect the features of an image with the help of OpenCV and make use of them to match and search for images.

    Chapter 7, Detecting and Recognizing Objects, introduces the concept of detecting and recognizing objects, which is one of the most common challenges in computer vision.

    Chapter 8, Tracking Objects, explores the vast topic of object tracking, which is the process of locating a moving object in a movie or video feed with the help of a camera.

    Chapter 9, Neural Networks with OpenCV – an Introduction, introduces you to Artificial Neural Networks in OpenCV and illustrates their usage in a real-life application.

    Setting Up OpenCV

    You picked up this book so you may already have an idea of what OpenCV is. Maybe, you heard of Sci-Fi-sounding features, such as face detection, and got intrigued. If this is the case, youve made the perfect choice. OpenCV stands for Open Source Computer Vision. It is a free computer vision library that allows you to manipulate images and videos to accomplish a variety of tasks from displaying the feed of a webcam to potentially teaching a robot to recognize real-life objects.

    In this book, you will learn to leverage the immense potential of OpenCV with the Python programming language. Python is an elegant language with a relatively shallow learning curve and very powerful features. This chapter is a quick guide to setting up Python 2.7, OpenCV, and other related libraries. After setup, we also look at OpenCVs Python sample scripts and documentation.

    If you wish to skip the installation process and jump right into action, you can download the virtual machine

    剩余内容已隐藏,支付完成后下载完整资料


    资料编号:[596078],资料为PDF文档或Word文档,PDF文档可免费转换为Word

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。