image = | logicalNotImg (inBinImg) |
Logical not of a binary input image.
On output image values are given by:
(with
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
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLLogical as logic
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outImg = logic.logicalNotImg(inImg)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLLogical/Processor/LogicalNotImg/LogicalNotImg.h>
Code Example
ImagePtr pAutoOutImg = logicalNotImg(pInBinImg);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
logicalNotImg(pInBinImg, pOutImg);