Pgm
PGMLoader
Bases: KoshLoader
Source code in kosh/loaders/pgm.py
__init__(obj, **kargs)
PGMLoader for Kosh to be able to read in pgm image files
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
Kosh obj reference |
required |
describe_feature(feature)
describe_feature describe the feature as a dictionary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
feature |
str
|
feature to describe |
required |
Returns:
Type | Description |
---|---|
dict
|
dictionary with attributes describing the feature: 'size', 'format', 'max_value' |
Source code in kosh/loaders/pgm.py
extract()
get a feature
Returns:
Type | Description |
---|---|
numpy.ndarray
|
numpy array |
Source code in kosh/loaders/pgm.py
list_features()
list_features lists features available
Returns:
Type | Description |
---|---|
list
|
list of features you can retrievea ["iamge", ] in our case |
open(mode='rb')
open the pgm reader
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode |
str, optional
|
mode to open the file in, defaults to 'r' |
'rb'
|
Returns:
Type | Description |
---|---|
file
|
Image file |