At a glance this is per-pixel histogram is that right? If so I guess that could be speeded up using a ‘sliding window’ approach… no doubt you know this and the problem is the time/effort to produce it 
At a glance this is per-pixel histogram is that right? If so I guess that could be speeded up using a ‘sliding window’ approach… no doubt you know this and the problem is the time/effort to produce it 