The Common Vision Blox image. More...
Inherits object.
Inherited by DeviceImage, PanoramicMappedImage, StreamImage, and WrappedImage.
Public Member Functions | |
cvb.Image | clone (self) |
Creates a new image object, that is a copy of the current instance. More... | |
None | copy (self, cvb.Image target_image, Optional[cvb.Rect] source_rect, Optional[cvb.Point2D] target_position) |
Copies the image data from the source rectangle of this image to the target position inside the target image. More... | |
cvb.Image | create (int width, int height, Optional[int] num_planes, Optional[cvb.DataType] data_type) |
Creates an uninitialized image with the given parameters. More... | |
cvb.Image | create (cvb.Size2D size, Optional[int] num_planes, Optional[cvb.DataType] data_type) |
Creates an uninitialized image with the given parameters. More... | |
cvb.Image | from_images (int mapping, List[cvb.Image] images) |
Create an image that is the result of concatenating a series of input images. More... | |
cvb.Image | from_pixel_format (cvb.Size2D size, int format) |
Creates an uninitialized image with the given parameters. More... | |
cvb.Image | from_pixel_format (int width, int height, int format) |
Creates an uninitialized image with the given parameters. More... | |
cvb.Image | from_planes (int mapping, List[cvb.ImagePlane] planes) |
Create an image that is the result of concatenating a series of input planes. More... | |
List[float] | get_pixel (self, cvb.Point2D position) |
Gets the pixel values for all planes at a give position (as float list). More... | |
cvb.Point2D | image_to_pixel_coordinates (self, cvb.Point2D point) |
Convert a point from image to pixel coordinates. More... | |
cvb.Area2D | image_to_pixel_coordinates (self, cvb.Area2D area) |
Convert an area from image to pixel coordinates. More... | |
cvb.Image | load (str file_name) |
Loads an image with the given file name. More... | |
cvb.Image | map (self, cvb.Rect source_rect, Optional[cvb.Size2D] target_size) |
Creates a mapped image of the region of that image scaled to the size. More... | |
cvb.Image | map_rotated (self, int rotation) |
Creates a mapped image of this whole image rotated by the given rotation. More... | |
cvb.Point2D | pixel_to_image_coordinates (self, cvb.Point2D point) |
Convert a point from pixel to image coordinates. More... | |
cvb.Point2D | pixel_to_image_coordinates (self, cvb.Point2D area) |
Convert an area from pixel to image coordinates. More... | |
None | raise_pixel_content_changed (self, cvb.Rect rect) |
Inform clients listening to the pixel content changed event, that the image data has been updated in the given rectangle. More... | |
cvb.EventCookie | register_event_pixel_content_changed (self, Callable[[cvb.Image, cvb.Rect], None] handler) |
Register a listener to the pixel content changed event. More... | |
None | save (self) |
Write the current content of the image into a file. More... | |
None | save (self, str file_name, float quality) |
Write the current content of the image into a file with the given quality. More... | |
None | unregister_event_pixel_content_changed (self, cvb.EventCookie event_cookie) |
Manually unregister a listener from the pixel content changed event. More... | |
Properties | |
bounds = property | |
cvb.Rect: Bounding rectangle of the image in pixels. | |
color_model = property | |
int: Color model realized by this image (see cvb.ColorModel). | |
coordinate_system = property | |
cvb.AffineMatrix2D: Gets or sets the coordinate system of the image. | |
height = property | |
int: Height of the image in pixels. | |
plane_data_types_identical = property | |
bool: Check if all planes have the same data type. | |
planes = property | |
List[cvb.ImagePlane]: Access all planes for this image. | |
size = property | |
cvb.Size2D: Size of the image in pixels. | |
width = property | |
int: Width of the image in pixels. | |
The Common Vision Blox image.
Supports the same arguments as cvb.Image.create or cvb.Image.load.
*args : Any Parameters like cvb.Image.create or cvb.Image.load.
**kwargs : Any Parameters like cvb.Image.create or cvb.Image.load.
cvb.Image clone | ( | self | ) |
Creates a new image object, that is a copy of the current instance.
This method performs a deep copy of the image data the current instance currently points to.
This means that if you clone a driver image, you receive a new plain cvb.Image without any driver interfaces.
cvb.Image A new image object that is a deep copy of this image data.
None copy | ( | self, | |
cvb.Image | target_image, | ||
Optional[cvb.Rect] | source_rect, | ||
Optional[cvb.Point2D] | target_position | ||
) |
Copies the image data from the source rectangle of this image to the target position inside the target image.
target_image : cvb.Image Image to copy to.
source_rect : Optional[cvb.Rect] Source rectangle in pixels to copy from (defaults to the entire image).
target_position : Optional[cvb.Point2D] Position in the target image in pixels to copy to (defaults to 0,0).
cvb.Image create | ( | cvb.Size2D | size, |
Optional[int] | num_planes, | ||
Optional[cvb.DataType] | data_type | ||
) |
Creates an uninitialized image with the given parameters.
size : cvb.Size2D Size of the image in pixels.
num_planes : Optional[int] Number of (color) planes (default 1).
data_type : Optional[cvb.DataType] Pixel data type (None means 8 bit).
cvb.Image The created image.
cvb.Image create | ( | int | width, |
int | height, | ||
Optional[int] | num_planes, | ||
Optional[cvb.DataType] | data_type | ||
) |
Creates an uninitialized image with the given parameters.
width : int Width of the image in pixels.
height : int Height of the image in pixels.
num_planes : Optional[int] Number of (color) planes (default 1).
data_type : Optional[cvb.DataType] Pixel data type (None means 8 bit).
cvb.Image The created image.
Create an image that is the result of concatenating a series of input images.
mapping : int Selects the relationship between the result image and the input images (see cvb.MappingOption).
images : List[cvb.Image] Images to be concatenated. All images in the input array must have equal size.
cvb.Image A concatenated image.
cvb.Image from_pixel_format | ( | cvb.Size2D | size, |
int | format | ||
) |
Creates an uninitialized image with the given parameters.
size : cvb.Size2D Size of the image in pixels.
format : int Pixel format of the image (see cvb.PfncFormat).
cvb.Image The created image.
cvb.Image from_pixel_format | ( | int | width, |
int | height, | ||
int | format | ||
) |
Creates an uninitialized image with the given parameters.
width : int Width of the image in pixels.
height : int Height of the image in pixels.
format : int Pixel format of the image (see cvb.PfncFormat).
cvb.Image The created image.
cvb.Image from_planes | ( | int | mapping, |
List[cvb.ImagePlane] | planes | ||
) |
Create an image that is the result of concatenating a series of input planes.
mapping : int Selects the relationship between the result image and the input images (see cvb.MappingOption).
planes : List[cvb.ImagePlane] Planes to be concatenated. All planes in the input array must have equal size.
cvb.Image A concatenated image.
List[float] get_pixel | ( | self, | |
cvb.Point2D | position | ||
) |
Gets the pixel values for all planes at a give position (as float list).
position : cvb.Point2D Pixel position.
List[float] A list containing all pixel values.
cvb.Area2D image_to_pixel_coordinates | ( | self, | |
cvb.Area2D | area | ||
) |
Convert an area from image to pixel coordinates.
area : cvb.Area2D Area in image coordinates.
cvb.Area2D Same area in pixel coordinates.
cvb.Point2D image_to_pixel_coordinates | ( | self, | |
cvb.Point2D | point | ||
) |
Convert a point from image to pixel coordinates.
point : cvb.Point2D Point in image coordinates.
cvb.Point2D Same point in pixel coordinates.
cvb.Image load | ( | str | file_name | ) |
Loads an image with the given file name.
file_name : str The file name to load.
cvb.Image The loaded image.
cvb.Image map | ( | self, | |
cvb.Rect | source_rect, | ||
Optional[cvb.Size2D] | target_size | ||
) |
Creates a mapped image of the region of that image scaled to the size.
source_rect : cvb.Rect Region to create the map from.
target_size : Optional[cvb.Size2D] Target size of the mapped image (defaults to source_rect.size).
cvb.Image The mapped image.
cvb.Image map_rotated | ( | self, | |
int | rotation | ||
) |
Creates a mapped image of this whole image rotated by the given rotation.
This is simply a view to another image, no data is copied.
Please be aware that rotating an image map will have a negativeperformance impact when iterating through the mapped images' pixels.
rotation : int Rotation to apply
cvb.Image The mapped image.
cvb.Point2D pixel_to_image_coordinates | ( | self, | |
cvb.Point2D | area | ||
) |
Convert an area from pixel to image coordinates.
area : cvb.Point2D Area in pixel coordinates.
cvb.Point2D Same area in image coordinates.
cvb.Point2D pixel_to_image_coordinates | ( | self, | |
cvb.Point2D | point | ||
) |
Convert a point from pixel to image coordinates.
point : cvb.Point2D Point in pixel coordinates.
cvb.Point2D Same point in image coordinates.
None raise_pixel_content_changed | ( | self, | |
cvb.Rect | rect | ||
) |
Inform clients listening to the pixel content changed event, that the image data has been updated in the given rectangle.
rect : cvb.Rect Affected area.
cvb.EventCookie register_event_pixel_content_changed | ( | self, | |
Callable[[cvb.Image, cvb.Rect], None] | handler | ||
) |
Register a listener to the pixel content changed event.
handler : Callable[[cvb.Image, cvb.Rect], None] Listener to pixel content changed event.
cvb.EventCookie Event cookie to manually unregister the listener.
None save | ( | self | ) |
Write the current content of the image into a file.
The file format to be used is determined by the extension of the file name.
None save | ( | self, | |
str | file_name, | ||
float | quality | ||
) |
Write the current content of the image into a file with the given quality.
The file format to be used is determined by the extension of the file name. Quality parameter will be ignored if extension is not a lossy image.
file_name : str File name into which to save the image.
quality : float Quality at which to save the image. Should be between 0..1
None unregister_event_pixel_content_changed | ( | self, | |
cvb.EventCookie | event_cookie | ||
) |
Manually unregister a listener from the pixel content changed event.
event_cookie : cvb.EventCookie Event cookie obtained from registering the listener.