ImageSource
¶
This class describes an abstract image source from which images can be obtained.
Concrete implementations must implement the get_image
function.
get_image(self)
¶
Abstract function to retrieve an image from the image source.
Returns:
Type | Description |
---|---|
ndarray |
The image obtained from the image source |
Source code in core/cv/ImageSource.py
22 23 24 25 26 27 28 29 |
|
DirImageSource
¶
A concrete implementation of an image source. In this image source, images are retrieved from a directory in the file system. They are sorted by name and each time get_image is called, the index is incremented.
__init__(self, image_directory)
special
¶
Initialization of the DirImageSource. The images in the directory are read, sorted by name and stored in a list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_directory |
str |
The directory to look for images in. |
required |
Source code in core/cv/ImageSource.py
39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
get_image(self)
¶
Returns the lexicographically next image from the specified directory.
Returns:
Type | Description |
---|---|
ndarray |
The lexicographically next images from the specified directory. |
Source code in core/cv/ImageSource.py
53 54 55 56 57 58 59 60 61 |
|
RoboDKImageSource
¶
A concrete implementation of an image source. In this image source, images are retrieved from the RoboDK simulation. An artificial camera is used which renders the RoboDK Scene using the specified parameters.
__init__(self, camera_frame)
special
¶
Initialization of the RoboDKImageSource. The camera is created and opened using the specified parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
camera_frame |
str |
The name of the camera frame. |
required |
Source code in core/cv/ImageSource.py
79 80 81 82 83 84 85 86 87 88 89 90 |
|
get_image(self)
¶
Returns the current image from the artificial camera in the RoboDK scene.
Returns:
Type | Description |
---|---|
ndarray |
The current image form the artificial camera in the RoboDK scene. |
Source code in core/cv/ImageSource.py
92 93 94 95 96 97 98 99 100 101 102 |
|
PyUEyeImageSource
¶
A concrete implementation of an image source. In this image source, images are retrieved from the real uEye camera in the robotics lab. The communication is done via the pyueye python package.
__init__(self, camera_id)
special
¶
Initialization for PyUEyeImageSource. The connection to the camera is established and parameters, such as the exposure time are set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
camera_id |
int |
The ID of the camera to connect to. |
required |
Source code in core/cv/ImageSource.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
get_image(self)
¶
Returns the current image of the uEye camera.
Returns:
Type | Description |
---|---|
ndarray |
The current image of the uEye camera. |
Source code in core/cv/ImageSource.py
209 210 211 212 213 214 215 216 217 218 219 220 |
|