Effacer les filtres
Effacer les filtres

Calculate number of pixels changed by subtracting two BW images

2 vues (au cours des 30 derniers jours)
yang
yang le 8 Nov 2013
Modifié(e) : yang le 9 Nov 2013
Hello, I need to calculate number of pixels whose color changes in two BW images consecutively taken with my camera. Can someone provide me the code? Thanks!
For instance I have 1.jpg and 2.jpg.
if true
a = imread('1.jpg');
b = imread('2.jpg');
Z = imsubtract(a,b);
% code
end
After this code, I think I have to count the number of non-zero values in 'Z'?
I want to include the pixels changing either way (i.e. from black to white, and from white to black).
Thanks! Yang

Réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by