Processing neighborhoods of pixels