Skip to content

Commit d6d5c84

Browse files
Initial commit
0 parents  commit d6d5c84

27 files changed

+277
-0
lines changed

Default.sublime-commands

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"caption": "Python Computer Vision Snippets: Open Readme",
4+
"command": "open_file",
5+
"args": {
6+
"file": "${packages}/Python Computer Vision Snippets/README.md"
7+
}
8+
}
9+
]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 futureprogrammer360
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# 📸 Python Computer Vision Snippets
2+
3+
[![Downloads](https://img.shields.io/packagecontrol/dt/Python%20Computer%20Vision%20Snippets)](https://packagecontrol.io/packages/Python%20Computer%20Vision%20Snippets)
4+
[![Tag](https://img.shields.io/github/v/tag/futureprogrammer360/Python-Computer-Vision-Snippets?sort=semver)](https://github.com/futureprogrammer360/Python-Computer-Vision-Snippets/tags)
5+
[![Repo size](https://img.shields.io/github/repo-size/futureprogrammer360/Python-Computer-Vision-Snippets)](https://github.com/futureprogrammer360/Python-Computer-Vision-Snippets)
6+
[![License](https://img.shields.io/github/license/futureprogrammer360/Python-Computer-Vision-Snippets?style=flat-square)](https://github.com/futureprogrammer360/Python-Computer-Vision-Snippets/blob/master/LICENSE)
7+
8+
[Python Computer Vision Snippets](https://github.com/futureprogrammer360/Python-Computer-Vision-Snippets) is a collection of [Sublime Text](https://www.sublimetext.com/) snippets for computer vision and image processing in Python.
9+
10+
## 💻 Installation
11+
12+
The easiest way to install Python Computer Vision Snippets is through [Package Control](https://packagecontrol.io/packages/Python%20Computer%20Vision%20Snippets). After it is enabled inside Sublime Text, open the command palette and find **Package Control: Install Package** and press `ENTER`. Then, find **Python Computer Vision Snippets** in the list. Press `ENTER` again, and this package is installed!
13+
14+
## 📈 Snippets
15+
16+
* [Imports](#imports)
17+
* [OpenCV](#opencv)
18+
* [Pillow](#pillow)
19+
20+
### Imports
21+
22+
Import snippets start with `i` followed by the package/module's import alias.
23+
24+
| Trigger | Description |
25+
|----------|-------------------------|
26+
| `icv2` | `import cv2` |
27+
| `iImage` | `from PIL import Image` |
28+
29+
### OpenCV
30+
31+
| Trigger | Description |
32+
|---------------------|-------------------------|
33+
| `circle` | `cv2.circle` |
34+
| `cvtColor` | `cv2.cvtColor` |
35+
| `destroyAllWindows` | `cv2.destroyAllWindows` |
36+
| `imread` | `cv2.imread` |
37+
| `imshow` | `cv2.imshow` |
38+
| `imwrite` | `cv2.imwrite` |
39+
| `line` | `cv2.line` |
40+
| `putText` | `cv2.putText` |
41+
| `rectangle` | `cv2.rectangle` |
42+
| `resize` | `cv2.resize` |
43+
| `rotate` | `cv2.rotate` |
44+
| `VideoCapture` | `cv2.VideoCapture` |
45+
| `waitKey` | `cv2.waitKey` |
46+
47+
### Pillow
48+
49+
| Trigger | Description |
50+
|-------------|-----------------------|
51+
| `convert` | `Image.convert` |
52+
| `crop` | `Image.crop` |
53+
| `fromarray` | `PIL.Image.fromarray` |
54+
| `open` | `PIL.Image.open` |
55+
| `resize` | `Image.resize` |
56+
| `rotate` | `Image.rotate` |
57+
| `save` | `Image.save` |
58+
59+
The snippet files are in the [`snippets`](https://github.com/futureprogrammer360/Python-Computer-Vision-Snippets/tree/master/snippets) folder of [this GitHub repository](https://github.com/futureprogrammer360/Python-Computer-Vision-Snippets).

messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"install": "messages/install.txt"
3+
}

messages/install.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Greetings fellow computer vision enthusiast,
2+
3+
Thank you for installing the Python Computer Vision Snippets package. This is a collection of useful snippets for computer vision and image processing in Python.
4+
5+
To see the snippets available, check out the README.md file via the `Python Computer Vision Snippets: Open Readme` command in command palette.
6+
7+
Enjoy!
8+
9+
GitHub homepage: https://github.com/futureprogrammer360/Python%20Computer%20Vision%20Snippets
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
${1:cap} = cv2.VideoCapture(${2:0})
4+
]]></content>
5+
<tabTrigger>VideoCapture</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>cv2.VideoCapture</description>
8+
</snippet>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
cv2.circle(${1:img}, ${2:center}, ${3:radius}, ${4:color}, ${5:thickness})
4+
]]></content>
5+
<tabTrigger>circle</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>cv2.circle</description>
8+
</snippet>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
${1:img} = cv2.cvtColor(${2:img}, ${3:cv2.COLOR_BGR2GRAY})
4+
]]></content>
5+
<tabTrigger>cvtColor</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>cv2.cvtColor</description>
8+
</snippet>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
cv2.destroyAllWindows()
4+
]]></content>
5+
<tabTrigger>destroyAllWindows</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>cv2.destroyAllWindows</description>
8+
</snippet>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
${1:img} = cv2.imread(${2:filename})
4+
]]></content>
5+
<tabTrigger>imread</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>cv2.imread</description>
8+
</snippet>

0 commit comments

Comments
 (0)