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.