Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
bcf7d316
Commit
bcf7d316
authored
Sep 16, 2019
by
collin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grammer fixes on python image display tutorial
parent
d2872afc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
py_image_display.markdown
...torials/py_gui/py_image_display/py_image_display.markdown
+11
-11
No files found.
doc/py_tutorials/py_gui/py_image_display/py_image_display.markdown
View file @
bcf7d316
...
...
@@ -4,7 +4,7 @@ Getting Started with Images {#tutorial_py_image_display}
Goals
-----
-
Here, you will learn how to read an image, how to display it and how to save it back
-
Here, you will learn how to read an image, how to display it
,
and how to save it back
-
You will learn these functions :
**cv.imread()**
,
**cv.imshow()**
,
**cv.imwrite()**
-
Optionally, you will learn how to display images with Matplotlib
...
...
@@ -30,7 +30,7 @@ See the code below:
import numpy as np
import cv2 as cv
# Load a
n
color image in grayscale
# Load a color image in grayscale
img = cv.imread('messi5.jpg',0)
@endcode
...
...
@@ -43,7 +43,7 @@ Even if the image path is wrong, it won't throw any error, but `print img` will
Use the function
**cv.imshow()**
to display an image in a window. The window automatically fits to
the image size.
First argument is a window name which is a string.
s
econd argument is our image. You can create as
First argument is a window name which is a string.
S
econd argument is our image. You can create as
many windows as you wish, but with different window names.
@code{.py}
cv.imshow('image',img)
...
...
@@ -66,11 +66,11 @@ MUST use it to actually display the image.
specific window, use the function
**cv.destroyWindow()**
where you pass the exact window name as
the argument.
@note There is a special case where you can
already create a window and load
image to it later. In
that case, you can specify whether window is resizable or not. It is done with the function
**cv.namedWindow()**
. By default, the flag is cv.WINDOW_AUTOSIZE. But if you specify flag to be
cv.WINDOW_NORMAL, you can resize window. It will be helpful when image is too large in dimension
and
adding track bar
to windows.
@note There is a special case where you can
create an empty window and load an
image to it later. In
that case, you can specify whether
the
window is resizable or not. It is done with the function
**cv.namedWindow()**
. By default, the flag is cv.WINDOW_AUTOSIZE. But if you specify
the
flag to be
cv.WINDOW_NORMAL, you can resize window. It will be helpful when
an
image is too large in dimension
and
when adding track bars
to windows.
See the code below:
@code{.py}
...
...
@@ -91,8 +91,8 @@ This will save the image in PNG format in the working directory.
### Sum it up
Below program loads an image in grayscale, displays it, save the image if you press 's' and exit, or
simply exit without saving if you press ESC key.
Below program loads an image in grayscale, displays it, save
s
the image if you press 's' and exit, or
simply exit
s
without saving if you press ESC key.
@code{.py}
import numpy as np
import cv2 as cv
...
...
@@ -117,7 +117,7 @@ Using Matplotlib
Matplotlib is a plotting library for Python which gives you wide variety of plotting methods. You
will see them in coming articles. Here, you will learn how to display image with Matplotlib. You can
zoom images, save
it etc
using Matplotlib.
zoom images, save
them, etc,
using Matplotlib.
@code{.py}
import numpy as np
import cv2 as cv
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment