CVBpy 14.1
cvb/ImageLoadSave
1# CVBpy Example Script
2#
3# 1. Loads an image from file.
4# 2. Resizes it using pixel mapping.
5# 3 Save the file.
6#
7# Requires: -
8
9import os
10import cvb
11
12src_image = cvb.Image(os.path.join(cvb.install_path(), "tutorial", "Clara.bmp"))
13
14print("Loaded image size: " + str(src_image.width) + " x " + str(src_image.height))
15
16dst_image = src_image.map(src_image.bounds, cvb.Size2D(src_image.size.width * 2, src_image.size.height * 3))
17
18print("Mapped image size: " + str(dst_image.width) + " x " + str(dst_image.height))
19
20dst_image.save("Clara23.bmp")
The Common Vision Blox image.
Definition: __init__.py:2038
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition: __init__.py:5465
str install_path()
Directory Common Vision Blox has been installed to.
Definition: __init__.py:8257