It looks like calango
Project description
Calango Project
It looks like magic
Get started
Install with pip
pip install calango
or
python -m pip install calango
Mouse Interface
from calango.devices import Mouse
mouse = Mouse()
mouse.up() # move mouse pointer [up, down, left, right, top_left, top_right ...
mouse.position = (10, 10) # move mouse pointer to (x, y)
print(mouse.position) # return current postion
Image API
Image reading
from calango import Image
image = Image(image_or_path='image.png')
image[:50, :50].plot() # plot image cropped (0:50, 0:50)
image.right.top.plot() # get image cropped at right top corner
image.draw_text('Hello World!', pos='left_bottom') # draw text on image
image.height # return image height
image.width # return image width
image.center_position # return image center position
image.crop_by_center((20, 20)) # crop image by center
image.prune() # resize image to square size by min(width, height)
# ... and more
Video API
Video Writer
from calango import VideoWriter
import numpy as np
frames = [np.zeros((100, 100, 3), dtype=np.uint8) for _ in range(10)]
with VideoWriter('test.mp4', fps=10) as writer:
for frame in frames:
writer.add_frame(frame)
# OR INLINE
VideoWriter.write_frames('test.mp4', frames) # on end is closed automatically
Video from Camera
from calango import Video
cam = Video(0) # 0 is the default camera
cam.show() # is running in a new thread
cam.total_frames # return the total number of frames
cam.fps # return the frames per second
cam.is_opened # return True if the camera is opened
# ... and more
Video from File
from calango import Video
cam = Video('./video.mp4')
cam.show()
Video from frames directory
from calango import Video
cam = Video('./video/', fps=24)
cam.show()
Video from sequence of images
from calango import Video
images = ['./video/img1.jpg', './video/img2.jpg', './video/img3.jpg'] # or list of images
cam = Video(images, fps=10)
cam.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
calango-2.2.7.tar.gz
(16.0 kB
view details)
Built Distribution
calango-2.2.7-py3-none-any.whl
(17.3 kB
view details)
File details
Details for the file calango-2.2.7.tar.gz
.
File metadata
- Download URL: calango-2.2.7.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ad5e7a09d9281e28ad46e21099e5dddff7a00cc919b8f2e258a3640493a1e1d |
|
MD5 | 917ceae2e6df7b17d98ff189ad48e1e1 |
|
BLAKE2b-256 | 843e10d007d9ab6db5204ef037e1e26cf12588cc4369ac27075eaf0b3bf93fcc |
File details
Details for the file calango-2.2.7-py3-none-any.whl
.
File metadata
- Download URL: calango-2.2.7-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5b5274548f03c22f54daa2c7317ccf6e66548e47562db1817529748f18dd114 |
|
MD5 | f4a0fc1e30266af796ac60530e457a65 |
|
BLAKE2b-256 | f49339b4c4746f5d173eb1023edfe7b48ecaff67654263f156067e00418949fc |