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 
9 import os
10 import cvb
11 
12 src_image = cvb.Image(os.path.join(cvb.install_path(), "tutorial", "Clara.bmp"))
13 
14 print("Loaded image size: " + str(src_image.width) + " x " + str(src_image.height))
15 
16 dst_image = src_image.map(src_image.bounds, cvb.Size2D(src_image.size.width * 2, src_image.size.height * 3))
17 
18 print("Mapped image size: " + str(dst_image.width) + " x " + str(dst_image.height))
19 
20 dst_image.save("Clara23.bmp")
The Common Vision Blox image.
Definition: __init__.py:1737
str install_path()
Directory Common Vision Blox has been installed to.
Definition: __init__.py:7153
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition: __init__.py:4450