Specifications

Image Creation and Access
4-9
4
Creating Images
There are several ways of creating a new image:
Construct an
IplImage header by setting the attributes to appropriate
values, then call the function iplAllocateImage() to allocate
memory for the image or set the image data pointer to image data
(in a compatible format) that already exists.
Call
iplCreateImageHeader() to create an IplImage header, then
call the function
iplAllocateImage() to allocate memory for the
image or set the image data pointer to existing image data.
Convert a DIB image to an
IplImage using the functions
iplTranslateDIB() or iplConvertFromDIB(). See the section
Working in the Windows DIB Environment.”
Create a copy of existing image by calling iplCloneImage().
CreateImageHeader
Creates an IplImage
header according to the
specified attributes.
IplImage* iplCreateImageHeader(int
nChannels
,
int
alphaChannel
, int
depth
, char*
colorModel
,
char*
channelSeq
, int
dataOrder
, int
origin
, int
align
,
int
width
, int
height
, IplROI*
roi
, IplImage*
maskROI
,
void*
imageID
, IplTileInfo*
tileInfo
);
nChannels
Number of channels in the image.
alphaChannel
Alpha channel number (0 if there is no alpha
channel in the image).
depth
Bit depth of pixels. Can be one of
IPL_DEPTH_1U, IPL_DEPTH_8U, IPL_DEPTH_8S,
IPL_DEPTH_16U, IPL_DEPTH_16S,
IPL_DEPTH_32S,orIPL_DEPTH_32F. See Table
4-2.