How do I invert the colors of an image stored in Mat image in the Java API of OpenCV? Using image.inv() gets me an error.
Mat image
image.inv()
Just in case:
Mat invertcolormatrix= new Mat(image.rows(),image.cols(), image.type(), new Scalar(255,255,255)); Core.subtract(invertcolormatrix, image, image);