IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Logical not of a binary input image. More...

IPSDKIPLLOGICAL_API image::ImagePtr ipsdk::imaproc::logic::logicalNotImg (const image::ImageConstPtr &pInBinImg)
 wrapper function for logical not of a binary input image More...
 
IPSDKIPLLOGICAL_API void ipsdk::imaproc::logic::logicalNotImg (const image::ImageConstPtr &pInBinImg, const image::ImagePtr &pOutImg)
 wrapper function for logical not of a binary input image More...
 

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InBinImg [Input] binary image for processing operation X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInBinImg)

Global Rule description

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

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

Associated library

IPSDKIPLLogical

Header file

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);
See also
LogicalNotImgLvl1
LogicalNotImgLvl2
LogicalNotImgLvl3

Function Documentation

◆ logicalNotImg() [1/2]

IPSDKIPLLOGICAL_API image::ImagePtr ipsdk::imaproc::logic::logicalNotImg ( const image::ImageConstPtr pInBinImg)

wrapper function for logical not of a binary input image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ logicalNotImg() [2/2]

IPSDKIPLLOGICAL_API void ipsdk::imaproc::logic::logicalNotImg ( const image::ImageConstPtr pInBinImg,
const image::ImagePtr pOutImg 
)

wrapper function for logical not of a binary input image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure