MATLAB: How to compare one pixel to a neighbor pixel and also another pixel

digital image processingimage analysisimage processingImage Processing Toolbox

Also, how I can make a difference histogram of the comparison results? Or how I can make a difference histogram generally?

Best Answer

How do you want to compare them? Do you want to subtract them? If so you can use conv2(). Do you want to know how many times one gray level occurs next to another gray level? If so you can use graycomatrix().