Defines | Functions
himage2iplimage.h File Reference
#include <Halcon.h>
Include dependency graph for himage2iplimage.h:

Go to the source code of this file.

Defines

#define CPYIMG_COMPLEX2CV(depth, channels, width, height, type)
#define CPYIMG_STRUCT2CV(depth, channels, width, height, type)

Functions

template<class type >
IplImage * CPYIMG2CV (Hlong **himg, CvSize size, INT depth, INT channels, INT width, INT height)
IplImage * HImage2IplImage (Hlong **himg, INT channels, INT width, INT height, INT type)
 converts a HALCON image structure into an openCV Image

Define Documentation

#define CPYIMG_COMPLEX2CV (   depth,
  channels,
  width,
  height,
  type 
)
Value:
{                                                                                                                                                               \
        int pixelItLines = 1;                                                                                                           \
        int pixelItColumns = 1;                                                                                                         \
        int channelIt = 0;                                                                                                                      \
        iplimg = cvCreateImage(size, depth, channels);                          \
        for (pixelItLines = 0; pixelItLines < height ;pixelItLines++ )                          \
        {                                                                                                                                                       \
                for (pixelItColumns = 0;pixelItColumns < width; pixelItColumns++)               \
                {                                                                                                                                               \
                        CvScalar csv;                                                                                                           \
                        for(channelIt = 0; channelIt < channels / 2; channelIt++)                       \
                        {                                                                                                                                       \
                                csv.val[((channels/2- 1) - channelIt) * 2    ] = himg[channelIt][pixelItLines * width +  pixelItColumns]; \
                                csv.val[((channels/2- 1) - channelIt) * 2 + 1] = himg[channelIt][pixelItLines * width +  pixelItColumns]; \
                        }                                                                                                                                       \
                        cvSet2D(iplimg,pixelItLines,pixelItColumns,csv);                                        \
                }                                                                                                                                               \
        }                                                                                                                                                       \
}

Definition at line 83 of file himage2iplimage.h.

#define CPYIMG_STRUCT2CV (   depth,
  channels,
  width,
  height,
  type 
)
Value:
{                                                                                                                                                               \
        int pixelItLines = 1;                                                                                                           \
        int pixelItColumns = 1;                                                                                                         \
        int channelIt = 0;                                                                                                                      \
        iplimg = cvCreateImage(size, depth, channels);                          \
        for (pixelItLines = 0; pixelItLines < height ;pixelItLines++ )                          \
        {                                                                                                                                                       \
                for (pixelItColumns = 0;pixelItColumns < width; pixelItColumns++)               \
                {                                                                                                                                               \
                        CvScalar csv;                                                                                                           \
                        for(channelIt = 0; channelIt < channels; channelIt++)                           \
                                csv.val[(channels - 1) - channelIt] = himg[channelIt][pixelItLines * width +  pixelItColumns]; \
                        cvSet2D(iplimg,pixelItLines,pixelItColumns,csv);                                        \
                }                                                                                                                                               \
        }                                                                                                                                                       \
}

Definition at line 64 of file himage2iplimage.h.


Function Documentation

template<class type >
IplImage* CPYIMG2CV ( Hlong **  himg,
CvSize  size,
INT  depth,
INT  channels,
INT  width,
INT  height 
)

Definition at line 31 of file himage2iplimage.h.

IplImage* HImage2IplImage ( Hlong **  himg,
INT  channels,
INT  width,
INT  height,
INT  type 
)

converts a HALCON image structure into an openCV Image

Author:
Uli Klank
Date:
08/03/2007
Returns:
a new IplImage that must be deleted if the function is succesful else NULL
Remarks:
not all images types are compatible, if the return value is NULL, an error occured.
Parameters:
himgThe source image in an Halcon image format as an array of channels
channelsNumber of channels int the array given by himg, this information can not be extracted without proc_handle, so it has to be extracted before

Definition at line 114 of file himage2iplimage.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


cognitive_perception
Author(s): Ulrich F Klank
autogenerated on Thu May 23 2013 07:38:35