ITK  5.3.0
Insight Toolkit
Classes | Public Types | Static Public Member Functions | List of all members
itk::OpenCVImageBridge Class Reference

#include <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 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)
 
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)
 

Detailed Description

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.

Member Typedef Documentation

◆ Self

ITK stype type alias

Definition at line 64 of file itkOpenCVImageBridge.h.

Member Function Documentation

◆ checkMatchingTypes()

template<typename InputPixelType , typename OutputPixelType >
static void itk::OpenCVImageBridge::checkMatchingTypes ( unsigned int  outChannels)
inlinestaticprivate

Steps involved in this method are: 1) Handle converting between colorspaces 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 208 of file itkOpenCVImageBridge.h.

◆ CVMatToITKImage()

template<typename TOutputImageType >
static TOutputImageType::Pointer itk::OpenCVImageBridge::CVMatToITKImage ( const cv::Mat &  in)
static

cv::Mat -> itk::Image

◆ IplImageToITKImage()

template<typename TOutputImageType >
static TOutputImageType::Pointer itk::OpenCVImageBridge::IplImageToITKImage ( const IplImage *  in)
static

IplImage* -> itk::Image

◆ ITKConvertImageBuffer()

template<typename TOutputImageType , typename TPixel >
static void itk::OpenCVImageBridge::ITKConvertImageBuffer ( const char *  in,
TOutputImageType *  out,
unsigned int  inChannels,
int  imgWidth,
int  imgHeight,
int  widthStep 
)
inlinestaticprivate

Steps involved in this method are: 1) Handle converting between colorspaces 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 225 of file itkOpenCVImageBridge.h.

References itk::ConvertPixelBuffer< InputPixelType, OutputPixelType, OutputConvertTraits >::Convert(), itk::ConvertPixelBuffer< InputPixelType, OutputPixelType, OutputConvertTraits >::ConvertVectorImage(), and itk::Index< VDimension >::Fill().

◆ ITKConvertIplImageBuffer()

template<typename TOutputImageType , typename TPixel >
static void itk::OpenCVImageBridge::ITKConvertIplImageBuffer ( const IplImage *  in,
TOutputImageType *  out,
unsigned int  iDepth 
)
inlinestaticprivate

Steps involved in this method are: 1) Handle converting between colorspaces 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 95 of file itkOpenCVImageBridge.h.

◆ ITKConvertMatImageBuffer()

template<typename TOutputImageType , typename TPixel >
static void itk::OpenCVImageBridge::ITKConvertMatImageBuffer ( const cv::Mat &  in,
TOutputImageType *  out 
)
inlinestaticprivate

Steps involved in this method are: 1) Handle converting between colorspaces 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 155 of file itkOpenCVImageBridge.h.

◆ ITKImageToCVMat()

template<typename TInputImageType >
static cv::Mat itk::OpenCVImageBridge::ITKImageToCVMat ( const TInputImageType *  in,
bool  force3Channels = false 
)
static

itk::Image -> cv::Mat

◆ ITKImageToIplImage()

template<typename TInputImageType >
static IplImage* itk::OpenCVImageBridge::ITKImageToIplImage ( const TInputImageType *  in,
bool  force3Channels = false 
)
static

itk::Image -> IplImage*


The documentation for this class was generated from the following file: