How do you invert an image (reversing grayscale) in MATLAB?
+5
A:
If it's a grayscale intensity image of class uint8
, you can do this:
reversedImg = 255-img;
If it's a grayscale intensity image of class double
, the pixel values should be between 0 and 1, so you can do this:
reversedImg = 1-img;
gnovice
2010-06-16 04:48:42
+4
A:
I think that you're looking for the imcomplement function if you have the imaging processing toolbox.
Justin Peel
2010-06-16 04:49:27