CVBpy 15.0
All Classes Namespaces Functions Variables Enumerations Enumerator Properties Modules Pages
cvb/ImageLoadSave
1# @brief Example for loading and saving images.
2
3# CVBpy Example Script
4#
5# 1. Loads an image from file.
6# 2. Resizes it using pixel mapping.
7# 3 Save the file.
8#
9# Requires: -
10
11import os
12import cvb
13
14src_image = cvb.Image(os.path.join(cvb.install_path(), "tutorial", "Clara.bmp"))
15
16print("Loaded image size: " + str(src_image.width) + " x " + str(src_image.height))
17
18dst_image = src_image.map(src_image.bounds, cvb.Size2D(src_image.size.width * 2, src_image.size.height * 3))
19
20print("Mapped image size: " + str(dst_image.width) + " x " + str(dst_image.height))
21
22dst_image.save("Clara23.bmp")
The Common Vision Blox image.
Definition: __init__.py:2097
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition: __init__.py:5526
str install_path()
Directory Common Vision Blox has been installed to.
Definition: __init__.py:8318