IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Bitwise not operation on one input image More...

IPSDKIPLLOGICAL_API image::ImagePtr ipsdk::imaproc::logic::bitwiseNotImg (const image::ImageConstPtr &pInIntImg)
 wrapper function for bitwise not operation on one image, pixel by pixel More...
 
IPSDKIPLLOGICAL_API void ipsdk::imaproc::logic::bitwiseNotImg (const image::ImageConstPtr &pInIntImg, const image::ImagePtr &pOutImg)
 wrapper function for bitwise not operation on one image, pixel by pixel More...
 

Detailed Description

Bitwise not operation on one input image

If the input and output images buffer types are ipsdk::image::eImageBufferType::eIBT_Binary, then the operator ipsdk::imaproc::logic::logicalNotImg can be applied instead.

On output image values are given by:

\[ OutImg[i] = {\sim}(InIntImg[i]) \]

(with $\sim$ corresponding to the Bitwise not operator).

Input and output images must have same size and buffer type. Buffers must be of type integer.

A Bitwise not operator applied to one integer performs the logical not operation on each bit of the binary representation of this integer. As shown in the truth table below, the result in each position is 1 if the bit is 0; otherwise, the result is 0.

Input bit Output bit
0 1
1 0

For instance, if we compute the result of a Bitwise not on the integer 5, we obtain;

  ! 0101 (decimal  5)
  = 1010 (decimal 10)
See also
"Bitwise operation --- Wikipedia, The Free Encyclopedia", 2014, http://en.wikipedia.org/w/index.php?title=Bitwise_operation&oldid=604175200

Here is an example of a Bitwise not operation applied to one 2D binary image (black pixels have value 0, white pixels have value 1) :

bitwiseNotExample.png

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InIntImg [Input] image for processing operation (data contained in image buffer are integers) X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInIntImg)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSizeAndType (_pInIntImg,_pOutImg)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLLogical as logic

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# bitwize 'not' computation
outImg = logic.bitwiseNotImg(inImg)

Example of C++ code :

Example informations

Associated library

IPSDKIPLLogical

Header file

Code Example

// open input image
ImageGeometryPtr pImageGeometry = geometry2d(inType, sizeX, sizeY);
ImagePtr pInImg = loadRawImageFile(inPath, *pImageGeometry);
// compute bitwise not operation on input image
ImagePtr pOutImg = bitwiseNotImg(pInImg);
See also
BitwiseNotImgLvl1
BitwiseNotImgLvl2
BitwiseNotImgLvl3

Function Documentation

◆ bitwiseNotImg() [1/2]

IPSDKIPLLOGICAL_API image::ImagePtr ipsdk::imaproc::logic::bitwiseNotImg ( const image::ImageConstPtr pInIntImg)

wrapper function for bitwise not operation on one image, pixel by pixel

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ bitwiseNotImg() [2/2]

IPSDKIPLLOGICAL_API void ipsdk::imaproc::logic::bitwiseNotImg ( const image::ImageConstPtr pInIntImg,
const image::ImagePtr pOutImg 
)

wrapper function for bitwise not operation on one image, pixel by pixel

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure