Home Backend Development Python Tutorial Detailed explanation of installation examples of Anaconda and python on windows

Detailed explanation of installation examples of Anaconda and python on windows

Apr 24, 2017 pm 01:48 PM
python

This article mainly introduces you to the detailed tutorial of installing Anaconda and python on Windows. It is very good and has reference value. Friends who need it can refer to it

When it comes to digital image processing programming, most people may I think of matlab, but matlab also has its own shortcomings:

1. It is not open source and expensive.

2. The software capacity is large. Generally, it is 3G or above, and higher versions can even reach 5G or above.

3. It can only be used for research and is not easy to convert into software.

Therefore, we use the Python scripting language here for digital image processing.

To use Python, you must first install python, usually version 2.7 or above. Whether it is a Windows system or a Linux system, the installation is very simple.

To use python for various development and scientific calculations, you also need to install the corresponding packages. This is very similar to matlab, except that it is called a toolbox in matlab, and it is called a library or package in python. There are actually many digital image processing packages developed based on python scripting language, such as PIL, Pillow, OpenCV, scikit-image, etc.

Comparing these packages, PIL and Pillow only provide the most basic digital image processing, with limited functions; OpenCV is actually a C++ library that only provides a python interface, and the update speed is very slow. Up to now, python has developed to version 3.5, while opencv only supports version 2.7 of python; scikit-image is an image processing package based on scipy. It processes images as numpy arrays, just like matlab. Therefore, we finally chose scikit-image performs digital image processing.

1. Required installation packages

Because scikit-image is based on scipy for calculations, it is certain to install numpy and scipy. To display images, you also need to install the matplotlib package. To sum up, the required packages are:

1

2

3

4

5

6

7

8

9

Python >= 2.6

Numpy >= 1.6.1

Cython >= 0.21

Six >=1.4

SciPy >=0.9

Matplotlib >= 1.1.0

NetworkX >= 1.8

Pillow >= 1.7.8

dask[array] >= 0.5.0

Copy after login

Comparatively, it is very troublesome to install, especially scipy, which is basically impossible to install on Windows.

But don’t be afraid, we just need to choose an integrated installation environment. We recommend Anaconda. It integrates all the above required packages, so we actually only need to install it from beginning to end. Anaconda software is enough, nothing else needs to be installed.

2. Download and install anaconda

First go to www.continuum.io/downloads to download anaconda. The current version is python2 .7 version and python3.5 version, download the corresponding version and anaconda of the corresponding system. It is actually an sh script file, about 280M.

This series takes windows7+python3.5 as an example, so we download the version in the red box as shown below:

Detailed explanation of installation examples of Anaconda and python on windows

The name is: Anaconda3-2.4. 1-Windows-x86_64.exe

is an executable exe file. Once the download is complete, you can install it by double-clicking it.

When installing, assume that we install in the root directory of drive D, such as:

Detailed explanation of installation examples of Anaconda and python on windows

and select both options and write the installation path Enter environment variables.

Detailed explanation of installation examples of Anaconda and python on windows

Then just wait for the installation to complete.

After the installation is completed, open the windows command prompt:

Enter conda list to check which libraries are currently installed. The commonly used numpy and scipy are among them. If you have any packages that have not been installed, you can run

conda install *** to install them. (*** is the name of the required package)

If a package version is not the latest, run conda update *** to update it.

3. Simple test

anaconda comes with an editor spyder, we can use this editor to write code in the future .

Spyder.exe is placed in the scripts in the installation directory. For example, mine is D:/Anaconda3/scripts/spyder.exe. Just double-click it to run it. We can right-click and send to desktop shortcut, which will be more convenient to run in the future.

We simply write a program to test whether the installation is successful. This program is used to open a picture and display it. First prepare a picture, then open spyder and write the following code:

1

2

3

from skimage import io

img=io.imread('d:/dog.jpg')

io.imshow(img)

Copy after login

Change d:/dog.jpg to your picture location

Then click the green in the toolbar above Triangle is run, and finally

Detailed explanation of installation examples of Anaconda and python on windows

# is displayed. If the "Ipython console" in the lower right corner can display a picture, it means that our running environment is successfully installed.

We can select "variable explorer" in the upper right corner to view image information, such as

Detailed explanation of installation examples of Anaconda and python on windows

We can save this program, pay attention to the python script file The suffix is ​​py.

4. Submodule of skimage package

skimage包的全称是scikit-image SciKit (toolkit for SciPy) ,它对scipy.ndimage进行了扩展,提供了更多的图片处理功能。它是由python语言编写的,由scipy 社区开发和维护。skimage包由许多的子模块组成,各个子模块提供不同的功能。主要子模块列表如下:

子模块名称 主要实现功能
io读取、保存和显示图片或视频
data提供一些测试图片和样本数据
color颜色空间变换
filters图像增强、边缘检测、排序滤波器、自动阈值等
draw操作于numpy数组上的基本图形绘制,包括线条、矩形、圆和文本等
transform几何变换或其它变换,如旋转、拉伸和拉东变换等
morphology形态学操作,如开闭运算、骨架提取等
exposure图片强度调整,如亮度调整、直方图均衡等
feature特征检测与提取等
measure图像属性的测量,如相似性或等高线等
segmentation图像分割
restoration图像恢复
util通用函数

用到一些图片处理的操作函数时,需要导入对应的子模块,如果需要导入多个子模块,则用逗号隔开,如:

1

from skimage import io,data,color

Copy after login

The above is the detailed content of Detailed explanation of installation examples of Anaconda and python on windows. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

Python vs. JavaScript: The Learning Curve and Ease of Use Python vs. JavaScript: The Learning Curve and Ease of Use Apr 16, 2025 am 12:12 AM

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Choosing Between PHP and Python: A Guide Choosing Between PHP and Python: A Guide Apr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Python: A Deep Dive into Their History PHP and Python: A Deep Dive into Their History Apr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

How to run python with notepad How to run python with notepad Apr 16, 2025 pm 07:33 PM

Running Python code in Notepad requires the Python executable and NppExec plug-in to be installed. After installing Python and adding PATH to it, configure the command "python" and the parameter "{CURRENT_DIRECTORY}{FILE_NAME}" in the NppExec plug-in to run Python code in Notepad through the shortcut key "F6".

How to use VSCode How to use VSCode Apr 15, 2025 pm 11:21 PM

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages ​​and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

Golang vs. Python: Performance and Scalability Golang vs. Python: Performance and Scalability Apr 19, 2025 am 12:18 AM

Golang is better than Python in terms of performance and scalability. 1) Golang's compilation-type characteristics and efficient concurrency model make it perform well in high concurrency scenarios. 2) Python, as an interpreted language, executes slowly, but can optimize performance through tools such as Cython.

Python vs. C  : Learning Curves and Ease of Use Python vs. C : Learning Curves and Ease of Use Apr 19, 2025 am 12:20 AM

Python is easier to learn and use, while C is more powerful but complex. 1. Python syntax is concise and suitable for beginners. Dynamic typing and automatic memory management make it easy to use, but may cause runtime errors. 2.C provides low-level control and advanced features, suitable for high-performance applications, but has a high learning threshold and requires manual memory and type safety management.

See all articles