mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-29 11:22:14 +03:00
[opencv/en] Fix some typos, grammar and spelling (#5032)
This commit is contained in:
parent
3653c1efcc
commit
daa86a4e9b
@ -5,11 +5,11 @@ filename: learnopencv.py
|
|||||||
contributors:
|
contributors:
|
||||||
- ["Yogesh Ojha", "http://github.com/yogeshojha"]
|
- ["Yogesh Ojha", "http://github.com/yogeshojha"]
|
||||||
---
|
---
|
||||||
### Opencv
|
### OpenCV
|
||||||
|
|
||||||
OpenCV (Open Source Computer Vision) is a library of programming functions mainly aimed at real-time computer vision.
|
OpenCV (Open Source Computer Vision) is a library of programming functions mainly aimed at real-time computer vision.
|
||||||
Originally developed by Intel, it was later supported by Willow Garage then Itseez (which was later acquired by Intel).
|
Originally developed by Intel, it was later supported by Willow Garage then Itseez (which was later acquired by Intel).
|
||||||
OpenCV currently supports wide variety of languages like, C++, Python, Java etc
|
OpenCV currently supports wide variety of languages like, C++, Python, Java, etc.
|
||||||
|
|
||||||
#### Installation
|
#### Installation
|
||||||
Please refer to these articles for installation of OpenCV on your computer.
|
Please refer to these articles for installation of OpenCV on your computer.
|
||||||
@ -18,7 +18,7 @@ Please refer to these articles for installation of OpenCV on your computer.
|
|||||||
* Mac Installation Instructions (High Sierra): [https://medium.com/@nuwanprabhath/installing-opencv-in-macos-high-sierra-for-python-3-89c79f0a246a](https://medium.com/@nuwanprabhath/installing-opencv-in-macos-high-sierra-for-python-3-89c79f0a246a)
|
* Mac Installation Instructions (High Sierra): [https://medium.com/@nuwanprabhath/installing-opencv-in-macos-high-sierra-for-python-3-89c79f0a246a](https://medium.com/@nuwanprabhath/installing-opencv-in-macos-high-sierra-for-python-3-89c79f0a246a)
|
||||||
* Linux Installation Instructions (Ubuntu 18.04): [https://www.pyimagesearch.com/2018/05/28/ubuntu-18-04-how-to-install-opencv](https://www.pyimagesearch.com/2018/05/28/ubuntu-18-04-how-to-install-opencv)
|
* Linux Installation Instructions (Ubuntu 18.04): [https://www.pyimagesearch.com/2018/05/28/ubuntu-18-04-how-to-install-opencv](https://www.pyimagesearch.com/2018/05/28/ubuntu-18-04-how-to-install-opencv)
|
||||||
|
|
||||||
### Here we will be focusing on python implementation of OpenCV
|
### Here we will be focusing on Python implementation of OpenCV
|
||||||
|
|
||||||
```python
|
```python
|
||||||
# Reading image in OpenCV
|
# Reading image in OpenCV
|
||||||
@ -28,21 +28,21 @@ img = cv2.imread('cat.jpg')
|
|||||||
# Displaying the image
|
# Displaying the image
|
||||||
# imshow() function is used to display the image
|
# imshow() function is used to display the image
|
||||||
cv2.imshow('Image', img)
|
cv2.imshow('Image', img)
|
||||||
# Your first arguement is the title of the window and second parameter is image
|
# Your first argument is the title of the window and second parameter is image
|
||||||
# If you are getting error, Object Type None, your image path may be wrong. Please recheck the pack to the image
|
# If you are getting an error, Object Type None, your image path may be wrong. Please recheck the path to the image
|
||||||
cv2.waitKey(0)
|
cv2.waitKey(0)
|
||||||
# waitKey() is a keyboard binding function and takes arguement in milliseconds. For GUI events you MUST use waitKey() function.
|
# waitKey() is a keyboard binding function and takes an argument in milliseconds. For GUI events you MUST use waitKey() function.
|
||||||
|
|
||||||
# Writing an image
|
# Writing an image
|
||||||
cv2.imwrite('catgray.png', img)
|
cv2.imwrite('catgray.png', img)
|
||||||
# first arguement is the file name and second is the image
|
# The first argument is the file name and second is the image
|
||||||
|
|
||||||
# Convert image to grayscale
|
# Convert image to grayscale
|
||||||
gray_image = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
gray_image = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
||||||
|
|
||||||
# Capturing Video from Webcam
|
# Capturing Video from Webcam
|
||||||
cap = cv2.VideoCapture(0)
|
cap = cv2.VideoCapture(0)
|
||||||
# 0 is your camera, if you have multiple camera, you need to enter their id
|
# 0 is your camera, if you have multiple cameras, you need to enter their id
|
||||||
while True:
|
while True:
|
||||||
# Capturing frame-by-frame
|
# Capturing frame-by-frame
|
||||||
_, frame = cap.read()
|
_, frame = cap.read()
|
||||||
|
Loading…
Reference in New Issue
Block a user