Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
data : :obj:`numpy.ndarray`
An array of data with which to make the image. The first dimension
of the data should index rows, the second columns, and the third
individual pixel elements (IR values as uint16's).
frame : :obj:`str`
A string representing the frame of reference in which this image
lies.
Raises
------
ValueError
If the data is not a properly-formatted ndarray or frame is not a
string.
"""
Image.__init__(self, data, frame)
data : :obj:`numpy.ndarray`
An array of data with which to make the image. The first dimension
of the data should index rows, the second columns, and the third
individual pixel elements (three floats).
frame : :obj:`str`
A string representing the frame of reference in which this image
lies.
Raises
------
ValueError
If the data is not a properly-formatted ndarray or frame is not a
string.
"""
Image.__init__(self, data, frame)
individual pixel elements (two channels, both float).
The first channel should be the grayscale channel
which must be in the range (0, BINARY_IM_MAX_VAL).
The second channel should be the depth channel.
frame : :obj:`str`
A string representing the frame of reference in which this image
lies.
Raises
------
ValueError
If the data is not a properly-formatted ndarray or frame is not a
string.
"""
Image.__init__(self, data, frame)
of the data should index rows, the second columns, and the third
individual pixel elements (only one channel, all uint8).
The integer-valued data should correspond to segment labels.
frame : :obj:`str`
A string representing the frame of reference in which this image
lies.
Raises
------
ValueError
If the data is not a properly-formatted ndarray or frame is not a
string.
"""
self._num_segments = np.max(data) + 1
Image.__init__(self, data, frame)
data : :obj:`numpy.ndarray`
An array of data with which to make the image. The first dimension
of the data should index rows, the second columns, and the third
individual pixel elements (three floats).
frame : :obj:`str`
A string representing the frame of reference in which this image
lies.
Raises
------
ValueError
If the data is not a properly-formatted ndarray or frame is not a
string.
"""
Image.__init__(self, data, frame)
individual pixel elements (four channels, all float).
The first three channels should be the red, greed, and blue channels
which must be in the range (0, BINARY_IM_MAX_VAL).
The fourth channel should be the depth channel.
frame : :obj:`str`
A string representing the frame of reference in which this image
lies.
Raises
------
ValueError
If the data is not a properly-formatted ndarray or frame is not a
string.
"""
Image.__init__(self, data, frame)
data : :obj:`numpy.ndarray`
An array of data with which to make the image. The first dimension
of the data should index rows, the second columns, and the third
individual pixel elements (depths as floating point numbers).
frame : :obj:`str`
A string representing the frame of reference in which this image
lies.
Raises
------
ValueError
If the data is not a properly-formatted ndarray or frame is not a
string.
"""
Image.__init__(self, data, frame)
self._data = self._data.astype(np.float32)
self._data[np.isnan(self._data)] = 0.0
self._encoding = 'passthrough'
greyscale.
frame : :obj:`str`
A string representing the frame of reference in which this image
lies.
encoding : :obj:`str`
Either rgb8 or bgr8, depending on the channel storage mode
Raises
------
ValueError
If the data is not a properly-formatted ndarray or frame is not a
string.
"""
Image.__init__(self, data, frame)
self._encoding = encoding
if self._encoding != 'rgb8' and self._encoding != 'bgr8':
raise ValueError(
'Illegal encoding: %s. Please use rgb8 or bgr8' %
(self._encoding))
if self._encoding == 'rgb8':
self.r_axis = 0
self.g_axis = 1
self.b_axis = 2
else:
self.r_axis = 2
self.g_axis = 1
self.b_axis = 0
An array of data with which to make the image. The first dimension
of the data should index rows, the second columns, and the third
individual pixel elements (greyscale values as uint8's).
frame : :obj:`str`
A string representing the frame of reference in which this image
lies.
Raises
------
ValueError
If the data is not a properly-formatted ndarray or frame is not a
string.
"""
self._encoding = 'mono16'
Image.__init__(self, data, frame)