IPSDK 0.2
IPSDK : Image Processing Software Development Kit
imagelogicalNotImg (inBinImg)

Detailed Description

Logical not of a binary input image.

On output image values are given by:

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

(with $\neg$ corresponding to the logical not operator).

Input and output images must have same size and their buffer type must be ipsdk::image::eImageBufferType::eIBT_Binary.

When the Logical not operator is applied to a binary value, the result is 1 if the input value is 0; otherwise, the result is 0.

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

See also
"Negation --- Wikipedia, The Free Encyclopedia", 2015, http://en.wikipedia.org/wiki/Negation
LogicalNotExample.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLLogical as logic

Code Example

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

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLLogical/Processor/LogicalNotImg/LogicalNotImg.h>

Code Example

// Sample with a generated output image
// ------------------------------------
// compute logical not for input images
ImagePtr pAutoOutImg = logicalNotImg(pInBinImg);
// Sample with a provided output image
// -----------------------------------
// create output image
ImageGeometryPtr pOutputImageGeometry = geometry2d(eImageBufferType::eIBT_Binary, sizeX, sizeY);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
// compute multiplication of input images
logicalNotImg(pInBinImg, pOutImg);