Specifications

Image Arithmetic and Logical Operations
5-3
5
Monadic Arithmetic Operations
The sections that follow describe the library functions that perform
monadic arithmetic operations (note that the
iplPreMultiplyAlpha
function is described in the “Image Compositing Based on Opacity
section of this chapter). All these functions use a single input image to
create an output image.
AddS, AddSFP
Adds a constant to pixel
values of the source
image.
void iplAddS(IplImage*
srcImage
, IplImage*
dstImage
, int
value
);
void iplAddSFP(IplImage*
srcImage
, IplImage*
dstImage
,
float
value
); /* images with IPL_DEPTH_32F only */
srcImage
Thesourceimage.
dstImage
The resultant image.
value
The value to be added to the pixel values.
Discussion
The functions change the image intensity by adding the
value
to pixel
values. A positive
value
brightens the image (increases the intensity); a
negative
value
darkens the image (decreases the intensity).