Find local differences in a matrix

This is an image palette containing RGB value
cmap=
0 0 0
0.5019 0 0
0.7529 0.7529 0.752
0 0.5019 0.5019
1 0 0
0.5019 0.5019 0.50196
0 0 0.50196
1 1 1
1 1 0
0.5019 0.5019 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
calculate this formula
D(cmap)=cmap(x,y)- cmap(x,y-1)

1 commentaire

Anusha
Anusha le 21 Oct 2013
ADD part
After calculating D(cmap), Find
R=-(∑D(cmap))^2

Connectez-vous pour commenter.

 Réponse acceptée

Plus de réponses (1)

David Sanchez
David Sanchez le 21 Oct 2013
For k=2:3
D = cmap(:,k) - cmap(:,k-1);
end

Catégories

En savoir plus sur Color and Styling dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by