i need negative image
165 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello .. I need help with transformation in grey level to transform cameraman.tiff image to negative version .. using Matlab code .. thanks
4 comentarios
Adam
el 28 de Oct. de 2015
Off the top of my head
doc imread
doc max
are all you really need beyond simple operations, although I'm not familiar with whether any specific scaling or shifting of the image data is done when negating it.
Respuestas (3)
Image Analyst
el 28 de Oct. de 2015
Try this with a uint8 image:
positiveImage = imread('CameraMan.tif');
negativeImage = 255 - positiveImage;
0 comentarios
VIBHOR AGARWAL
el 8 de Feb. de 2018
Editada: VIBHOR AGARWAL
el 8 de Feb. de 2018
You can also use MATLAB's in built function- `imcomplement(Image)` for this purpose.
0 comentarios
DGM
el 25 de Abr. de 2022
Editada: DGM
el 25 de Abr. de 2022
It's best to avoid writing your code around unchecked assumptions of array class.
If you have Image Processing Toolbox, imcomplement() should work fine.
A = imread('peppers.png');
B = imcomplement(A);
imshow(B)
If you don't have IPT, MIMT iminv() (attached) does the same thing. It will work fine for images of any standard numeric/logical class. If you want to know how it works, just open it up and see.
A = imread('peppers.png');
B = iminv(A);
imshow(B)
0 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!