Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit de12022

Browse filesBrowse files
committed
Fix line wrapping from #625
Strip trailing whitespace (cherry picked from commit 932a66a78bac5b41f723758ba6dd6489c1346215)
1 parent b02a66a commit de12022
Copy full SHA for de12022

File tree

Expand file treeCollapse file tree

1 file changed

+33
-31
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+33
-31
lines changed

‎docs/scenarios/imaging.rst

Copy file name to clipboardExpand all lines: docs/scenarios/imaging.rst
+33-31Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
Image Manipulation
33
==================
44

5-
.. todo::
6-
Add introduction about image manipulation and its Python libraries.
7-
8-
Most image processing and manipulation techniques can be carried out effectively using
9-
two libraries: Python Imaging Library (PIL) and OpenSource Computer Vision (OpenCV).
5+
Most image processing and manipulation techniques can be carried out
6+
effectively using two libraries: Python Imaging Library (PIL) and OpenSource
7+
Computer Vision (OpenCV).
108

119
A brief description of both is given below.
1210

@@ -39,24 +37,24 @@ Example
3937

4038
.. code-block:: python
4139
42-
from PIL import Image, ImageFilter
43-
#Read image
44-
im = Image.open( 'image.jpg' )
45-
#Display image
46-
im.show()
40+
from PIL import Image, ImageFilter
41+
#Read image
42+
im = Image.open( 'image.jpg' )
43+
#Display image
44+
im.show()
4745
48-
#Applying a filter to the image
49-
im_sharp = im.filter( ImageFilter.SHARPEN )
50-
#Saving the filtered image to a new file
51-
im_sharp.save( 'image_sharpened.jpg', 'JPEG' )
46+
#Applying a filter to the image
47+
im_sharp = im.filter( ImageFilter.SHARPEN )
48+
#Saving the filtered image to a new file
49+
im_sharp.save( 'image_sharpened.jpg', 'JPEG' )
5250
53-
#Splitting the image into its respective bands, i.e. Red, Green,
54-
#and Blue for RGB
55-
r,g,b = im_sharp.split()
51+
#Splitting the image into its respective bands, i.e. Red, Green,
52+
#and Blue for RGB
53+
r,g,b = im_sharp.split()
5654
57-
#Viewing EXIF data embedded in image
58-
exif_data = im._getexif()
59-
exif_data
55+
#Viewing EXIF data embedded in image
56+
exif_data = im._getexif()
57+
exif_data
6058
6159
There are more examples of the Pillow library in the
6260
`Pillow tutorial <http://pillow.readthedocs.org/en/3.0.x/handbook/tutorial.html>`_.
@@ -65,20 +63,23 @@ There are more examples of the Pillow library in the
6563
OpenSource Computer Vision
6664
--------------------------
6765

68-
OpenSource Computer Vision, more commonly known as OpenCV, is a more advanced image manipulation and processing software than PIL. It has been implemented in several
69-
languages and is widely used.
66+
OpenSource Computer Vision, more commonly known as OpenCV, is a more advanced
67+
image manipulation and processing software than PIL. It has been implemented
68+
in several languages and is widely used.
7069

7170
Installation
7271
~~~~~~~~~~~~
7372

74-
In Python, image processing using OpenCV is implemented using the ``cv2`` and ``NumPy`` modules.
75-
The `installation instructions for OpenCV <http://docs.opencv.org/2.4/doc/tutorials/introduction/table_of_content_introduction/table_of_content_introduction.html#table-of-content-introduction>`_ should guide you through configuring the project for yourself.
73+
In Python, image processing using OpenCV is implemented using the ``cv2`` and
74+
``NumPy`` modules. The `installation instructions for OpenCV
75+
<http://docs.opencv.org/2.4/doc/tutorials/introduction/table_of_content_introduction/table_of_content_introduction.html#table-of-content-introduction>`_
76+
should guide you through configuring the project for yourself.
7677

7778
NumPy can be downloaded from the Python Package Index(PyPI):
7879

7980
.. code-block:: console
80-
81-
$ pip install numpy
81+
82+
$ pip install numpy
8283
8384
8485
Example
@@ -87,7 +88,7 @@ Example
8788
.. code-block:: python
8889
8990
from cv2 import *
90-
import numpy as np
91+
import numpy as np
9192
#Read Image
9293
img = cv2.imread('testimg.jpg')
9394
#Display Image
@@ -97,9 +98,10 @@ Example
9798
9899
#Applying Grayscale filter to image
99100
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
100-
101-
#Saving filtered image to new file
102-
cv2.imwrite('graytest.jpg',gray)
103101
104-
There are more Python-implemented examples of OpenCV in this `collection of tutorials <http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_tutorials.html>`_.
102+
#Saving filtered image to new file
103+
cv2.imwrite('graytest.jpg',gray)
105104
105+
There are more Python-implemented examples of OpenCV in this `collection of
106+
tutorials
107+
<http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_tutorials.html>`_.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.