In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
In digital image processing, we often need to read, save, scale, crop, rotate, color conversion and other basic operations. When programming with python, it involves the choice of several different image processing libraries. Today we will briefly talk about these libraries: opencv, scikit-image, scipy, pillow, matplotlib, etc. (excluding deep learning: tf.image, etc.)
1. PIL (Python Imaging Library)
PIL (Python Imaging Library) is a commonly used image processing library of Python, while Pillow is a friendly Fork of PIL, which provides a wide range of file format support and powerful image processing capabilities, including image storage, image display, format conversion and basic image processing operations. It is lighter than opencv. Image module is a common module in Python PIL image processing, and the basic functions of image operation are basically included in this module. Such as open, save, show and other functions.
2. Scipy.misc
Python has three very popular libraries in the field of scientific computing, numpy, SciPy and matplotlib. Numpy is a high-performance library for calculating multi-dimensional arrays. SciPy is built on the basis of numpy. It provides many functions for manipulating numpy arrays. SciPy is a convenient, easy-to-use python toolkit designed for science and engineering. It includes statistics, optimization, integration and linear algebra modules, Fourier transform, signal and image legends, and the solution of ordinary differential variance.
3. Opencv
OpenCV is an open source computer vision application platform, initiated by the Intel R & D center Russia team, open source BSD certificate, OpenCV's goal is to achieve real-time computer vision, is a cross-platform computer vision library. It has developed rapidly since the date of development, and has received great support and contribution from many companies and industry. Because it is an BSD open source license, it can be used in scientific research and commercial applications free of charge.
OpenCV already includes the following application areas: 2D and 3D feature toolbox, motion estimation, face recognition system, posture recognition, human-computer interaction, mobile robot, motion understanding, object identification, segmentation and recognition, stereo vision, motion tracking, augmented reality (AR technology). Based on the needs of the above functions, OpenCV also includes the following statistics-based machine learning libraries: Boosting algorithm, Decision Tree (decision tree) learning, Gradient Boosting algorithm, EM algorithm (expectation maximization), KNN algorithm, naive Bayesian classification, artificial neural network, random forest, palm vector machine.
Programming language: most of the modules in OpenCV are based on C++, and a few of them are based on C language. The SDK provided by OpenCV already supports C++, Java, Python and other language application development. At present, the newly developed algorithms and module interfaces of OpenCV itself are based on C++. OpenCV-Python uses Numpy, a highly optimized database operation library with MATLAB-style syntax. All OpenCV array structures are converted to Numpy arrays. This also makes it easier to integrate with other libraries that use Numpy, such as SciPy and Matplotlib.
Note: Cv2 defaults to BGR order, while other software (PIL, scopy.misc) generally use RGB
4. Matplotlib
Matplotlib is a Python 2D drawing library that can generate release quality data in various hard copy formats and interactive environments on different platforms. Matplotlib can be used for Python scripting, Python and IPython shell, Jupyter notebook, web application server, and four graphical user interface toolkits. For simple drawings, the pyplot module provides an interface similar to matlab, especially when used in conjunction with IPython. For power users, you can fully control line styles, font properties, axis properties, etc., through an object-oriented interface or through a set of functions familiar to MATLAB users.
5. Skimagescikit-image is a set of algorithms for image processing and computer vision. The main package of "skimage" provides only some utilities for converting image data types; most functional programs are stored in their subpackages. The read function is included in the io module.
Use suggestion
1. Compared with these libraries, I prefer to use the opencv library for the basic operation of image processing. The data format is numpy, which can be directly processed by numpy.
two。 When drawing graphs such as line charts, the matplotlib library is generally used.
3. Opencv defaults to BGR order, while other software (PIL, scopy.misc) generally use RGB.
So... Which one do you pick?
In addition, the day before yesterday, a partner left a message that he wanted to learn the basics of python. These two days, he summed up some Python video learning tutorials. The comment replied: Python, you can get it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.