Image plane information container. More...
#include <cvb/image_plane.hpp>
Inherits IArray.
Public Member Functions | |
ImagePlane (ImagePlane &&other) noexcept=default | |
Move constructor. More... | |
ImagePlane (const class Plane &plane) | |
Implicitly convert a plane to an image plane. More... | |
void * | Handle () const noexcept |
Classic API image handle. More... | |
bool | TryContiguousAccess (std::uint8_t *&basePtr) const noexcept |
Attempt a contiguous access on the plane's pixels. More... | |
std::uint8_t * | ContiguousAccess () const |
Attempt a contiguous access on the plane's pixels. More... | |
bool | TryLinearAccess (LinearAccessData &linearAccessData) const noexcept |
Attempt a linear access on the plane's pixels. More... | |
LinearAccessData | LinearAccess () const |
Attempt a linear access on the plane's pixels. More... | |
class DataType | DataType () const noexcept override |
Data type descriptor for this array. More... | |
int | Rank () const noexcept |
Gets the number of dimensions for this array. More... | |
const Image & | Parent () const noexcept |
Image to which this plane descriptor refers to. More... | |
class Vpat | Vpat () const |
Accesses the virtual pixel access table. More... | |
std::unique_ptr< Image > | Map () const |
Create a map from a single image plane that shares its memory with the original plane. More... | |
double | GetPixel (Point2D< int > position) const |
Gets the pixel value at the given position. More... | |
int | Plane () const noexcept |
Plane index in the image, to which this plane refers to. | |
template<class Type > | |
ContiguousIterator< Type > | BeginContiguous () |
Get iterator access to the plane. More... | |
template<class Type > | |
ContiguousIterator< Type > | EndContiguous () |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< ContiguousIterator< Type > > | RBeginContiguous () |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< ContiguousIterator< Type > > | REndContiguous () |
Get iterator access to the plane. More... | |
template<class Type > | |
ContiguousConstIterator< Type > | CBeginContiguous () const |
Get iterator access to the plane. More... | |
template<class Type > | |
ContiguousConstIterator< Type > | BeginContiguous () const |
Get iterator access to the plane. More... | |
template<class Type > | |
ContiguousConstIterator< Type > | CEndContiguous () const |
Get iterator access to the plane. More... | |
template<class Type > | |
ContiguousConstIterator< Type > | EndContiguous () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< ContiguousConstIterator< Type > > | CRBeginContiguous () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< ContiguousConstIterator< Type > > | RBeginContiguous () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< ContiguousConstIterator< Type > > | CREndContiguous () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< ContiguousConstIterator< Type > > | REndContiguous () const |
Get iterator access to the plane. More... | |
template<class Type > | |
LinearIterator< Type > | BeginLinear () |
Get iterator access to the plane. More... | |
template<class Type > | |
LinearIterator< Type > | EndLinear () |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< LinearIterator< Type > > | RBeginLinear () |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< LinearIterator< Type > > | REndLinear () |
Get iterator access to the plane. More... | |
template<class Type > | |
LinearConstIterator< Type > | CBeginLinear () const |
Get iterator access to the plane. More... | |
template<class Type > | |
LinearConstIterator< Type > | BeginLinear () const |
Get iterator access to the plane. More... | |
template<class Type > | |
LinearConstIterator< Type > | CEndLinear () const |
Get iterator access to the plane. More... | |
template<class Type > | |
LinearConstIterator< Type > | EndLinear () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< LinearConstIterator< Type > > | CRBeginLinear () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< LinearConstIterator< Type > > | RBeginLinear () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< LinearConstIterator< Type > > | CREndLinear () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< LinearConstIterator< Type > > | REndLinear () const |
Get iterator access to the plane. More... | |
template<class Type > | |
VpatIterator< Type > | BeginVpat () |
Get iterator access to the plane. More... | |
template<class Type > | |
VpatIterator< Type > | EndVpat () |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< VpatIterator< Type > > | RBeginVpat () |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< VpatIterator< Type > > | REndVpat () |
Get iterator access to the plane. More... | |
template<class Type > | |
VpatConstIterator< Type > | CBeginVpat () const |
Get iterator access to the plane. More... | |
template<class Type > | |
VpatConstIterator< Type > | BeginVpat () const |
Get iterator access to the plane. More... | |
template<class Type > | |
VpatConstIterator< Type > | CEndVpat () const |
Get iterator access to the plane. More... | |
template<class Type > | |
VpatConstIterator< Type > | EndVpat () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< VpatConstIterator< Type > > | CRBeginVpat () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< VpatConstIterator< Type > > | RBeginVpat () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< VpatConstIterator< Type > > | CREndVpat () const |
Get iterator access to the plane. More... | |
template<class Type > | |
std::reverse_iterator< VpatConstIterator< Type > > | REndVpat () const |
Get iterator access to the plane. More... | |
virtual void * | Handle () const noexcept=0 |
Classic API image handle. More... | |
virtual class DataType | DataType () const noexcept=0 |
Data type descriptor for this array. More... | |
virtual int | Rank () const noexcept=0 |
Gets the number of dimensions for this array. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<class VISITOR , class... PLANEARGS> | |
auto | Visit (VISITOR &&visitor, const ImagePlane &plane, const PLANEARGS &... planes) |
Creates Cvb::Block s based on the planes objects' access traits and pixel type, and calls the given visitor with them. More... | |
template<class PIXEL_TYPE , class VISITOR , class... PLANEARGS> | |
auto | VisitAs (VISITOR &&visitor, const ImagePlane &plane, const PLANEARGS &... planes) |
Creates Cvb::Block s based on the planes objects' access traits and PIXEL_TYPE and calls the given visitor with them. When the PIXEL_TYPE is compile-time known, this overload is useful to avoid unnecessary template instantiations. More... | |
std::vector< int > | Histogram (const ImagePlane &plane, Area2D aoi, double density=1.0) |
Gather and return the histogram from an 8 bits per pixel unsigned image. More... | |
std::vector< int > | Histogram (const ImagePlane &plane, double density=1.0) |
Gather and return the histogram from an 8 bits per pixel unsigned image. More... | |
std::vector< LocalMaximum > | FindLocalMaxima (const ImagePlane &plane, int locality, double threshold, Rect< int > aoi) |
Find local maxima in the input image. More... | |
std::vector< LocalMaximum > | FindLocalMaxima (const ImagePlane &plane, int locality, double threshold) |
Find local maxima in the input image. More... | |
std::vector< LocalMaximum > | FindLocalMaxima (const ImagePlane &plane, int locality, double threshold, SubPixelMode mode, Neighborhood radius, Rect< int > aoi) |
Find sub pixel accurate local maxima in the input image. More... | |
std::vector< LocalMaximum > | FindLocalMaxima (const ImagePlane &plane, int locality, double threshold, SubPixelMode mode, Neighborhood radius) |
Find sub pixel accurate local maxima in the input image. More... | |
Image plane information container.
|
defaultnoexcept |
Move constructor.
[in] | other | Other plane. |
Does | not throw any exception. |
|
inline |
Implicitly convert a plane to an image plane.
[in] | plane | Plane to convert to image plane. |
Any | exception derived from std::exception including CvbException. |
Only two dimensional plane can be converted to image planes. Otherwise this conversion will throw.
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Attempt a contiguous access on the plane's pixels.
Any | exception derived from std::exception including CvbException. |
This method does the same as TryContiguousAccess(), but will throw if contiguous access is not possible.
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
Data type descriptor for this array.
Does | not throw any exception. |
Implements IArray.
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Gets the pixel value at the given position.
[in] | position | Pixel position. |
Any | exception derived from std::exception including CvbException. |
|
inlinevirtualnoexcept |
Classic API image handle.
Does | not throw any exception. |
It is normally not necessary to work with this handle.
Implements IArray.
|
inline |
Attempt a linear access on the plane's pixels.
Any | exception derived from std::exception including CvbException. |
This method does the same as TryLinearAccess(), but will throw if linear access is not possible.
|
inline |
Create a map from a single image plane that shares its memory with the original plane.
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Image to which this plane descriptor refers to.
Does | not throw any exception. |
|
inlinevirtualnoexcept |
Gets the number of dimensions for this array.
Does | not throw any exception. |
Implements IArray.
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The memory must be contiguous.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
The plane must allow linear access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get iterator access to the plane.
Use only if needed, as it is the lowest access.
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Attempt a contiguous access on the plane's pixels.
[in] | basePtr | Pointer to the first pixel. |
Does | not throw any exception. |
This function will try to get the linear increments in x and y. Then it will analyze the increments and if the image plane's memory is contiguous it will return the base pointer.
|
inlinenoexcept |
Attempt a linear access on the plane's pixels.
[in] | linearAccessData | Data structure receiving the values for accessing the pixels. |
Does | not throw any exception. |
This function scans the image's VPAT for the possibility to access the individual pixels with linear increments in x and y direction. If either of the VPATs are jumbled, it will return false, otherwise the values in LinearAccessData can be used to calculate the address of each pixel.
Accesses the virtual pixel access table.
Any | exception derived from std::exception including CvbException. |
Normally this property only needs to be accessed if you want to access the underlying CVB image on the pixel level. Note that VPAT access is one of the slower access modes. If possible, linear access is preferred.
|
related |
Find local maxima in the input image.
[in] | plane | Image plane in which to look for maxima. |
[in] | locality | Minimum distance between two valid maxima; if two maxima fall within this distance (measured using the L1 norm), the one with the lower gray value will be removed from the result. |
[in] | threshold | Minimum gray value a local maximum must have for being reported. |
Any | exception derived from std::exception including CvbException. |
|
related |
Find local maxima in the input image.
[in] | plane | Image plane in which to look for maxima. |
[in] | locality | Minimum distance between two valid maxima; if two maxima fall within this distance (measured using the L1 norm), the one with the lower gray value will be removed from the result. |
[in] | threshold | Minimum gray value a local maximum must have for being reported. |
[in] | aoi | Region of interest in which to look for maxima. |
Any | exception derived from std::exception including CvbException. |
|
related |
Find sub pixel accurate local maxima in the input image.
[in] | plane | Image plane in which to look for maxima. |
[in] | locality | Minimum distance between two valid maxima; if two maxima fall within this distance (measured using the L1 norm), the one with the lower gray value will be removed from the result list. |
[in] | threshold | Minimum gray value a local maximum must have for being reported. |
[in] | mode | Mode to be used for determining sub pixel accuracy. |
[in] | radius | Neighborhood to take account in the sub pixel calculation. |
Any | exception derived from std::exception including CvbException. |
Sub pixel accuracy is achieved by assuming a Gaussian or parabolic gray value distribution around a local maximum that can be fitted into the image data.
|
related |
Find sub pixel accurate local maxima in the input image.
[in] | plane | Image plane in which to look for maxima. |
[in] | locality | Minimum distance between two valid maxima; if two maxima fall within this distance (measured using the L1 norm), the one with the lower gray value will be removed from the result list. |
[in] | threshold | Minimum gray value a local maximum must have for being reported. |
[in] | mode | Mode to be used for determining sub pixel accuracy. |
[in] | radius | Neighborhood to take account in the sub pixel calculation. |
[in] | aoi | Region of interest in which to look for maxima. |
Any | exception derived from std::exception including CvbException. |
Sub pixel accuracy is achieved by assuming a Gaussian or parabolic gray value distribution around a local maximum that can be fitted into the image data.
|
related |
Gather and return the histogram from an 8 bits per pixel unsigned image.
[in] | plane | Plane to gather the histogram from. |
[in] | aoi | Area in which to gather the histogram. |
[in] | density | Scan density to generate the histogram. It must be in the range [0...1]. Lower densities result in higher processing speed, but will also yield histograms, which are notably jagged due to the poor statistics. |
Any | exception derived from std::exception including CvbException. |
|
related |
Gather and return the histogram from an 8 bits per pixel unsigned image.
[in] | plane | Plane to gather the histogram from. |
[in] | density | Scan density to gather the histogram with; must be in the range [0...1]; lower densities result in higher processing speed, but will also yield histograms which are notably jagged due to the poor statistics |
Any | exception derived from std::exception including CvbException. |
|
related |
Creates Cvb::Block
s based on the planes objects' access traits and pixel type, and calls the given visitor with them.
The planes must have the same pixel type. If all planes support Cvb::ArrayAccess, then all blocks forwarded to the visitor are of type Cvb::ArrayPlaneBlock, if all are of Cvb::LinearAccess, all blocks will be of type Cvb::LinearPlaneBlock, otherwise of type Cvb::VpatPlaneBlock.
VISITOR | Callable that is called with the typed Cvb::Block. |
[in] | visitor | Callable of signature auto(Block<T,ACCESS_TRAIT>, ...) . |
[in] | planes | Planes to create typed Cvb::Block s for that will be forwarded to the visitor. |
std::runtime_error | if no pixel type could be matched. |
std::domain_error | if properties of the planes differ. |
|
related |
Creates Cvb::Block
s based on the planes objects' access traits and PIXEL_TYPE and calls the given visitor with them. When the PIXEL_TYPE is compile-time known, this overload is useful to avoid unnecessary template instantiations.
The planes must have the same pixel type. If all planes support Cvb::ArrayAccess, then all blocks forwarded to the visitor are of type Cvb::ArrayPlaneBlock, if all are of Cvb::LinearAccess, all blocks will be of type Cvb::LinearPlaneBlock, otherwise of type Cvb::VpatPlaneBlock.
PIXEL_TYPE | The pixel type of the planes. |
VISITOR | Callable that is called with the typed Cvb::Block. |
[in] | visitor | Callable of signature auto(Block<PIXEL_TYPE,ACCESS_TRAIT>, ...) . |
[in] | planes | Planes to create typed Cvb::Block s for that will be forwarded to the visitor. |
std::runtime_error | if no pixel type could be matched |
std::domain_error | if properties of the planes differ. |