In relation to the translation about "OpenCV-Python Tutorials", this time I compared it with mahotas.
There are several libraries that use Python for image recognition, but there is also a library called mahotas. This also uses the data format of numpy. For libraries that perform image recognition with Python,
--Python binding to the development result in C ++ (OpenCV-Python) --Those that are accelerated using the Cython language based on the framework of numpy and Python (scikit-image) --Developing in C ++ while focusing on being a library for Python
there is. mahotas is developed in C ++, devoting itself to being a library for Python.
mahotas Why did you not simply contribute to scipy.ndimage or scikits.image? It explains why mahotas exists as a library different from scipy and scikit-image.
You can get the latest information about all the functions implemented in mahotas by launching [Python (x, y)] [Documentation] [Python documentation server] and accessing mahotas from site-packages.
http://mahotas.readthedocs.org/en/latest/index.html
###** Introduction to OpenCV **
Let's get started with OpenCV-Python
Install OpenCV-Python on Windows Make OpenCV available on windows.
Make OpenCV available on Fedora.
If you are using Python (x, y) on Windows, first >>> import mahotas Please try. If there are no errors, you have already confirmed that mahotas is installed as a standard Python (x, y) plugin. If you get an error, you can get a compiled python module [Christoph Gohlke's site] It's a good idea to install from (http://www.lfd.uci.edu/~gohlke/pythonlibs/). I don't recommend compiling from source code in Visual Studio (Note 1) How to install Mahotas is shown on the Mahotas site as follows:
mahotas How To Install Mahotas
###** GUI features in OpenCV ** Let's start image manipulation 画像を読み込むこと、表示すること、保存することを学びます。
Let's start video operation 動画の再生、カメラからの動画のキャプチャと動画としての保存を学びましょう。
OpenCV drawing functions 直線、矩形、楕円、円などをOpenCVを使って描画することを学びます。
Use mouse as paint brush マウスを使って塗りつぶし
Use Trackbar as a color palette パラメータを制御するためのtrackbarを作る
###** Core operation ** Basic operations on images
You will learn how to read and edit pixel values, operate images in the ROI (region of interest), and other basic operations.
"Practical machine learning system" Chapter 10 Computer vision pattern recognition Loading images using mahotas is introduced. Again, the data format after reading is numpy.array. The function name is also imread (). Since mahotas.imread (name) is read in RGB order, it is compatible when displayed by imshow () of matplotlib. (Note 2)
python
#!/usr/bin/python
# -*- coding: utf-8 -*-
import mahotas as mh
import pylab as plt
img=mh.imread("img_0000.png ")
plt.figure(1)
plt.imshow(img)
plt.show()
Performs arithmetic operations on the image.
[Execution performance measurement and improvement method] (http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_core/py_optimization/py_optimization.html#optimization-techniques)
It's important to get the answer. But getting the answer the fastest is even more important. Check the speed of your code, learn to optimize your code and more.
Mathematical methods in OpenCV PCA(Principalcomponentsanalysis 主成分分析)、SVD(singularvaluedecomposition 特異値分解)などのOpenCVで提供されている数学的手法のいくつかを学びます。
###** Image processing with OpenCV **
Change color space 異なる色空間で画像を変換する方法を学びましょう。そして動画で色つきの物体を追跡させてみましょう。
mahotas Color Space Conversions
Is there a conversion to sepia that is characteristic of mahotas color space conversion? Since the conversion of the color space of OpenCV is substantial, it is better to use it as a supplement.
lenas = mh.colors.rgb2sepia(lena)
Geometric transformation of images 回転、変形などのさまざまな幾何変換を施してみましょう。
Image Threshold Processing 画像をグローバルしきい値、適応的閾値処理 、大津の2値化などで2値化画像に変換してみましょう。
mahotas also includes the binarization of Otsu. Another binarization method Riddler-Calvard method is also implemented.
Image Smoothing 画像をぼかしたり、あつらえたカーネルを用いた画像にフィルタすることを学びます。
Mol of contraction, expansion, Opening, Closing, etc. Learn about phology transformations.
Expansion and contraction are included in OpenCV, but conditional expansion and contraction are not included in OpenCV and mahotas It is included in, and it seems that it is worth using it well.
mahotas Dilation & Erosion
mahotas Conditional morphological erosion.
mahotas Conditional dilation
Find image gradients, edges, etc. Let's do it.
Let's find the edge using Canny edge detection.
mahotas Sobel edge detection
mahotas has a Difference of Gaussian. Compute edges using the Difference of Gaussian (DoG) operator. This differential operation is included in the procedure for calculating SIFT features. OpenCV does not have a direct Difference of Gaussian. An example of its implementation on stackoverflowを見つけて利用してみることができます。
Image Pyramid 画像ピラミッドとそれを画像混合に使う方法を学びます。
####** Contour processing with OpenCV **
Find the outline and draw
Learn about finding various contour features, areas, perimeters, circumscribing rectangles, etc.
OpenCV is arguably the most complete library for image processing and image recognition, but binding in Python does not necessarily mean that all of its features are available. Labeling, for example, is one such feature. Libraries such as mahotas can make up for the missing features in the current OpenCV-Python framework (cv2) (Note 3).
Contour Properties Learn to find various contour characteristics, solidity, average strength and more.
Learn to find convexity defects, point Polygon Tests, and match with different shapes.
mahotas Convex hull convex hull
Learn about the hierarchy of contours.
Histogram in OpenCV OpenCVにあるヒストグラムの全て。
OpenCV Histogram in OpenCV
Histograms-1: Find, plot and analyze! !! !!
Find the histogram and draw it.
Learn to flatten the histogram to get a good contrast image.
Learn to find and plot a 2D histogram.
Learn to back-project a histogram on an object colored by region.
Image conversion with OpenCV フーリエ変換、コサイン変換などOpenCVにある様々な画像変換に出会ってみましょう。
Template Matching テンプレートマッチングを用いて画像中から物体を探してみましょう。
mahotas Match template to image
Hough Transform 画像の中から線を検出してみましょう。
Hough Transform 画像の中から円を検出してみましょう。
Image segmentation based on the Watershed algorithm Let's divide the image area using the Watershed algorithm.
mahotas [Seeded watershed in n-dimensions] (http://mahotas.readthedocs.org/en/latest/api.html?highlight=watershed#mahotas.cwatershed)
Let's extract the foreground with the GrabCut algorithm.
###** Feature detection and feature description **
What are the main features of the image? How useful are these features found?
Harris Corner Detection ええ、コーナーはよい特徴? でもどうやって見つけますか?
[Shi-Tomasi Corner Detector and Good Features to Track](http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_shi_tomasi/py_shi_tomasi.html#shi- tomasi) Let's take a look at the details of Shi-Tomasi corner detection.
Introduction to SIFT (Scale-Invariant Feature Transform) Features
Harris corner detectors are not good enough when the scale of the image changes. Lowe has developed a breakthrough method to find features that do not affect scale. It is called SIFT features.
SIFT features are certainly good features. But it's not fast enough. Therefore, a high-speed version called SURF features was created.
mahotas also has SURF. Speeded-Up Robust Features
FAST algorithm for corner detection 上に示した特徴検出器は全てよいものです。しかし、SLAM(訳注:SimultaneousLocalizationandMapping、自己位置推定と環境地図作成を同時に行うこと)のようなリアルタイムの用途に使えるほど十分に速いとは言えません。そこでFASTアルゴリズムの登場です。これは本当に"FAST(速い)"です。
BRIEF Independent Elementary Features SIFT特徴量は、128個の浮動小数点からなる特徴記述子を用いています。そのような特徴量を数千個あつかうことを考えてごらんなさい。そのときたくさんのメモリーとマッチングのためにたくさんの時間を使 is. You can compress the features to make them faster, but you still have to calculate the features first. That's where BRIEF comes in, offering a shortcut to finding binary descriptors with less memory, faster matching, and higher recognition.
ORB (Oriented FAST and Rotated BRIEF) features SIFT特徴量とSURF特徴量はとてもよく動くのだけれども、あなたの用途の中で使うには毎年数ドル払わなければならないとしたらどうしますか? それらは特許が成立しているのです。その問題を解決するには、OpenCVの開発者はSIFT特徴量とSURF特徴量への新しい"FREE"な代替品、ORBを思いつきました。
Feature Matching 特徴検出器と記述子についてたくさん理解しました。異なる記述子を対応付ける方法を学ぶときです。OpenCVはそのために2つの手法、Brute-Forceマッチング手法とFLANNに基づくマッチング手法です。
Feature matching and homography for finding objects いま特徴量マッチングについて知っているので、複雑な画像中の物体を見つけるためにcalib3dモジュールとともに混ぜ合わせてみましょう。
Mahotas contains Haralic features that can distinguish between smooth and patterned images.
SURF features are also included in mahotas. "10.4 Description by local features"]
mahotas Local Binary Patterns
###** Video analysis ** Meanshift and Camshift Tracking (http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_video/py_meanshift/py_meanshift.html#meanshift)
We have already seen an example of color-based tracking. It's simple. Let's take a look at how the better algorithm, mean shift and its improved version, CamShift, find and track objects.
[Optical flow] (http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.html#lucas-kanade) Let's learn about the important concept, optical flow. It is related to video and has many uses.
In some applications, it is necessary to extract the foreground like object tracking. Background removal is a well-known technique that helps in those cases.
###** Camera calibration and 3D reconstruction **
Camera Calibration 利用しているカメラがどれだけ良いものか試してみましょう。それで撮影した画像に歪みが見られるでしょうか?もしあれば、どう補正しましょうか?
Posture estimation A short session to help you create a little cool 3D effect with the calib module.
Epipolar Geometry エピポーラ幾何とエピポーラ制約を理解しましょう。
Depth distance information from stereo image 2D画像群から奥行き情報を得ます。
###** Machine learning ** K-nearest neighbor method K最近傍法の使い方を学ぶとともに、K最近傍法を用いて手書きの数字認識について学びます。
Support Vector Machine (SVM) SVMの考え方を理解します
K-means clustering A group of data using K-means clustering Learn to classify into clusters. Then you will learn to perform color quantization using the K-means method.
###Computational Photography Here you will learn about the various features of OpenCV related to Computational Photography, such as image denoising.
Image Noise Removal Non-local Meansノイズ除去と呼ばれる画像からノイズを除去する良好な手法を見ていただきます。
Image Repair たくさんの黒点とひっかきを生じた古い劣化した写真を持っていませんか?それを持ってきて、画像修復と呼ばれる方法でそれらを復元してみましょう。
###** Object detection ** Face detection using Haar cascade detector Haar カスケード検出器を用いた顔検出
###** OpenCV-Python binding ** Now let's learn how OpenCV-Python bindings are made.
How does the OpenCV-Python binding work? OpenCV-Pythonバインディングがどのように作られているのか学びましょう。
Note 1: In Visual Studio, it is necessary to have the same version of Visual Studio that you are using, and it is very troublesome to have the same version of Visual Studio that builds all the libraries you use. Note 2: In the case of cv2.imread (name), the order is BGR, so it is necessary to use cv2.cvtColor (img, cv2.COLOR_BGR2RGB). Note 3: How to implement OpenCV Python bindings in cv2 is as described in the OpenCV-Python tutorial. In that way, advanced Python and C ++ users will be able to implement functions for which bindings have not been implemented. And how wonderful it is to donate it to the OpenCV community.