extension joomla, template joomla,banner extension joomla,jomla slider,slider joomla
Producing negative of a grayscale image: C++ and OpenCV

Theory
The concept behind negative of grayscale image is very simple. Just subtract each intensity level of an image from 255. The negative transformation is given by the function
  s = L – 1 – r
Where s is the pixel after transformation, r is the pixel before transformation and L is the maximum intensity level (in our case it is 256).

Program
The program is written in C++ using OpenCV library in QT IDE. If you are using QT IDE then add the following line of code in .pro file.

INCLUDEPATH += /usr/include/opencv/
CONFIG += link_pkgconfig
PKGCONFIG += opencv
LIBS += -Icv -Ihighhui

Output

 



Related Article



destination source:https://www.programming-techniques.com/2013/01/producing-nagative-of-grayscale-image-c.html