how to compare the value of a pixel with all other pixel?
2 次查看(过去 30 天)
显示 更早的评论
i have to compare each pixel with all other pixels and find equal values.
0 个评论
采纳的回答
Andrei Bobrov
2013-10-28
M = randi(10,40,30);
uM = unique(M);
out = [uM, histc(M(:),uM)];
3 个评论
Image Analyst
2013-10-28
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.
更多回答(2 个)
Jos (10584)
2013-10-28
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)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modify Image Colors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!