How to convert multiple rgb snapshots into grayscale and save them into a folder?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Omar Ahmad
el 23 de Nov. de 2014
Comentada: Image Analyst
el 29 de Nov. de 2014
I've taken multiple rgb snapshots and saved them into the folder using for-loop. But now I need to know how those snapshots can be converted into grayscale and save them into a folder.
After the above has been done, I need to know how both of these (rgb and gray) can be subtracted so that the difference is spotted.
Please help. thank you very much in advance.
0 comentarios
Respuesta aceptada
Image Analyst
el 23 de Nov. de 2014
Try this:
grayImage = rgb2gray(rgbImage);
diffGray = double(grayImage) - double(grayReferenceImage);
diffRGB = double(rgbImage) - double(rgbReferenceImage);
if max(abs(diffGray(:))) > 0
% There is at least one different pixel.
end
13 comentarios
Image Analyst
el 29 de Nov. de 2014
OK, you want to binarize the difference signal by thresholding it and turning it into a logical array. So you can do something like
binaryImage = diffRGB > someValue; % Like 2 or 5 or whatever
Pick a value that you want to see if the difference is greater than. Like if the difference between the images is more than 3 gray levels, show it, otherwise consider them the same with essentially no difference at all.
Más respuestas (0)
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!