pycamera
Advanced tools
+2
-2
| Metadata-Version: 2.1 | ||
| Name: pycamera | ||
| Version: 0.1 | ||
| Summary: An easier solution to simple computer vision | ||
| Version: 0.2 | ||
| Summary: An easier solution to computer vision. | ||
| Home-page: https://github.com/IsmaeelAkram/pycamera | ||
@@ -6,0 +6,0 @@ Author: Ismaeel Akram |
| Metadata-Version: 2.1 | ||
| Name: pycamera | ||
| Version: 0.1 | ||
| Summary: An easier solution to simple computer vision | ||
| Version: 0.2 | ||
| Summary: An easier solution to computer vision. | ||
| Home-page: https://github.com/IsmaeelAkram/pycamera | ||
@@ -6,0 +6,0 @@ Author: Ismaeel Akram |
@@ -10,7 +10,13 @@ import cv2 | ||
| def to_numpy(self) -> np.ndarray: | ||
| """Returns raw NumPy array""" | ||
| return self.frame | ||
| def rgb(self): | ||
| return cv2.cvtColor(self.frame, cv2.COLOR_BGR2RGB) | ||
| """Converts BGR frame to RGB""" | ||
| return Frame(cv2.cvtColor(self.frame, cv2.COLOR_BGR2RGB)) | ||
| def pillow(self): | ||
| """Returns a PIL (Pillow) compatible image. Alias of rgb()""" | ||
| return self.rgb() | ||
| def show(self): | ||
@@ -20,2 +26,3 @@ cv2.imshow("pycamera frame", self.frame) | ||
| def save(self, fp: str): | ||
| """Writes image to file""" | ||
| cv2.imwrite(fp, self.frame) |
+25
-0
| # pycamera | ||
| An easier solution to computer vision. | ||
| ## What is pycamera? | ||
| Pycamera is a wrapper around OpenCV for people who, don't know how to use OpenCV, don't want to use OpenCV for such a simple project, or want something easier! | ||
| ## Installation | ||
| ```sh | ||
| pip3 install pycamera | ||
| ``` | ||
| This will install pycamera, NumPy, and OpenCV. | ||
| ## Example Usage | ||
| ```python | ||
| from pycamera import camera | ||
| cam = camera.Camera(1) # Choosing a camera | ||
| snap = cam.snap() # Snapping a picture from that camera | ||
| snap.save("output.jpg") # Save picture to output.jpg | ||
| ``` |
+2
-2
@@ -5,4 +5,4 @@ from setuptools import setup | ||
| name="pycamera", | ||
| version="0.1", | ||
| description="An easier solution to simple computer vision", | ||
| version="0.2", | ||
| description="An easier solution to computer vision.", | ||
| url="https://github.com/IsmaeelAkram/pycamera", | ||
@@ -9,0 +9,0 @@ author="Ismaeel Akram", |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
3830
24.63%45
15.38%