how to compare the value of a pixel with all other pixel?

2 Ansichten (letzte 30 Tage)
sheno39
sheno39 am 28 Okt. 2013
Beantwortet: sheno39 am 28 Okt. 2013
i have to compare each pixel with all other pixels and find equal values.

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 28 Okt. 2013
M = randi(10,40,30);
uM = unique(M);
out = [uM, histc(M(:),uM)];
  3 Kommentare
Image Analyst
Image Analyst am 28 Okt. 2013
You forgot to attach your texture1.jpg image. Don't make it hard for us to help you. Make it easy for us to help you by attaching your image.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Jos (10584)
Jos (10584) am 28 Okt. 2013
You question is a little unclear. But, see
help unique
M = ceil(10*rand(40,30)) % pixel image
uM = unique(M) ;
% and use it like this
tf = M==uM(k)
[r,c] = find(tf)
  1 Kommentar
sheno39
sheno39 am 28 Okt. 2013
sir i have to compare each pixel with all other pixels and if any pixels having equal values i have to increament the count.

Melden Sie sich an, um zu kommentieren.


sheno39
sheno39 am 28 Okt. 2013
i have attached my image here

Kategorien

Mehr zu Modify Image Colors finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by