Do Identical Histograms Remain the Same After Applying a Smoothing Mask?

2 replies · 6K views · last reply
Master1022
Messages
590
Reaction score
116
Homework Statement
The two texture images shown below are quite different, but their histograms are identical. Both images have size 80 × 80, with black (0) and white (1) pixels. Suppose that both images are blurred with a 3×3 smoothing mask. Would the resultant histograms still be the same?
Relevant Equations
Filter
Hi,

I was just looking at some conceptual problems on the internet and wanted to check whether my thought process on this question was correct.

Question: The two texture images shown below are quite different, but their histograms are identical. Both images have size 80 × 80, with black (0) and white (1) pixels. Suppose that both images are blurred with a 3×3 smoothing mask. Would the resultant histograms still be the same?

Two 80 by 80 binary images labelled a and b: a is split into a white left half and black right half, b is an 8 by 8 black and white checkerboard.


Attempt:
From what I understand, the smoothing mask will look like:
[tex] \frac{1}{9} \cdot \begin{pmatrix}<br /> 1 & 1 & 1 \\<br /> 1 & 1 & 1 \\<br /> 1 & 1 & 1 <br /> \end{pmatrix}[/tex]

Initial observations:
- Each box has dimensions of 10 x 10
- Number of pixels involved in the boundary of (a) is less than that of (b)
- Thus smoothing will alter more pixels in (b)
- Therefore, the histograms will be different after the filter is applied

Side question: how does the filter get applied at the edge of the image? Does it just 'hang' off the edge?
The reason I ask is because when the filter is applied to image (b), when the center of the filter is near the corner of any white square, I think it would be possible to get an intensity value of [itex]\frac{4}{9}[/itex]. The only way I can see this intensity value appearing in the histogram of filtered (a) is along some of the boundaries and edges if the filter is able to hang off the edge.

Thanks in advance for any help and guidance.
 
I think your answer is correct. On your question of what happens at the edge, there are several options, and you need to decide what you want the code to do. For example, look at this link to scipy.ndimage. The 'mode' description lists several options for how to deal with the edge.
 
  • Like
Likes   Reactions: Master1022 and collinsmark
phyzguy said:
I think your answer is correct. On your question of what happens at the edge, there are several options, and you need to decide what you want the code to do. For example, look at this link to scipy.ndimage. The 'mode' description lists several options for how to deal with the edge.
Thank you very much!