Do we have a function to invert gray image values? [ 0->1 , 1->0 or for bgr image 50->205, 205->50 ]
in emgucv i use like this : MaskImageMat_InfoFlow.ToImage<Bgr, byte>().Not() but in opencv i donāt know how do this.
k i found answer [for gray or bgr img], i msut use this function : cv::bitwise_not(MaskImageMat_InfoFlow, MaskImageMat_InfoFlow_Inverted);
yes ty, i tested it now, These two methods have the same result for the gray image but different results for the bgr image.
(1) bitwise_not
(2) 255 - img
itās interpreting 255 as cv::Scalar(255), which is ābroadcastā to be cv::Scalar(255, 0, 0), which is why the picture is blue, and all other colors go to black.
look at the catās chest, or any other dark region. thatās what happens when your method inverts black⦠arbitrary colors, but light instead of dark.