#include <itkOpenCVImageBridge.h>
This class provides static methods to convert between OpenCV images and itk::Image.
This class provides methods for the following conversions: IplImage -> itk::Image cv::Mat -> itk::Image itk::Image -> IplImage itk::Image -> cv::Mat
Each method is templated over the type of itk::Image used. The conversions copy the data and convert between types if necessary.
Definition at line 58 of file itkOpenCVImageBridge.h.
Classes | |
| struct | HandleRGBPixel |
| struct | HandleRGBPixel< RGBPixel< TValue >, VDimension > |
Public Types | |
| using | Self = OpenCVImageBridge |
Static Public Member Functions | |
| template<typename TOutputImageType> | |
| static TOutputImageType::Pointer | CVMatToITKImage (const cv::Mat &in) |
| template<typename TOutputImageType> | |
| static TOutputImageType::Pointer | IplImageToITKImage (const IplImage *in) |
| template<typename TInputImageType> | |
| static cv::Mat | ITKImageToCVMat (const TInputImageType *in, bool force3Channels=false) |
| template<typename TInputImageType> | |
| static IplImage * | ITKImageToIplImage (const TInputImageType *in, bool force3Channels=false) |
Static Private Member Functions | |
| template<typename InputPixelType, typename OutputPixelType> | |
| static void | checkMatchingTypes (unsigned int outChannels) |
| template<typename TOutputImageType, typename TPixel> | |
| static void | ITKConvertImageBuffer (const char *in, TOutputImageType *out, unsigned int inChannels, int imgWidth, int imgHeight, int widthStep) |
| template<typename TOutputImageType, typename TPixel> | |
| static void | ITKConvertIplImageBuffer (const IplImage *in, TOutputImageType *out, unsigned int iDepth) |
| template<typename TOutputImageType, typename TPixel> | |
| static void | ITKConvertMatImageBuffer (const cv::Mat &in, TOutputImageType *out) |
Definition at line 63 of file itkOpenCVImageBridge.h.
|
inlinestaticprivate |
Definition at line 206 of file itkOpenCVImageBridge.h.
Referenced by ITKConvertIplImageBuffer(), and ITKConvertMatImageBuffer().
|
static |
cv::Mat -> itk::Image
|
static |
IplImage* -> itk::Image
|
inlinestaticprivate |
Definition at line 223 of file itkOpenCVImageBridge.h.
References itk::ConvertPixelBuffer< InputPixelType, OutputPixelType, OutputConvertTraits >::Convert(), and itk::ConvertPixelBuffer< InputPixelType, OutputPixelType, OutputConvertTraits >::ConvertVectorImage().
Referenced by ITKConvertIplImageBuffer(), and ITKConvertMatImageBuffer().
|
inlinestaticprivate |
Steps involved in this method are: 1) Handle converting between color spaces 2) Allocate the output image 3) Create a copy of the current IplImage's buffer without any padding (slow but necessary) 4) Copy the buffer and convert the pixels if necessary
Definition at line 94 of file itkOpenCVImageBridge.h.
References checkMatchingTypes(), itk::FixedArray< ValueType, 1 >::Dimension, and ITKConvertImageBuffer().
|
inlinestaticprivate |
Definition at line 153 of file itkOpenCVImageBridge.h.
References checkMatchingTypes(), itk::FixedArray< ValueType, 1 >::Dimension, and ITKConvertImageBuffer().
|
static |
itk::Image -> cv::Mat
|
static |
itk::Image -> IplImage*