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

AI Thread Summary
Applying a 3×3 smoothing mask to two texture images with identical histograms will result in different histograms due to the varying pixel boundaries in each image. The smoothing process affects more pixels in one image than the other, leading to distinct intensity values post-filtering. The discussion also highlights the importance of understanding how filters are applied at the edges of images, noting that different methods can be used to handle edge cases. The application of the filter may produce unique intensity values that could influence the resultant histogram. Overall, the initial assumption that the histograms will differ after smoothing is supported by the analysis.
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?

Screen Shot 2021-01-07 at 5.59.19 PM.png


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

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 \frac{4}{9}. 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.
 
Physics news on Phys.org
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 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!
 

Similar threads

Replies
1
Views
1K
Replies
2
Views
7K
Replies
48
Views
11K
4
Replies
175
Views
25K
2
Replies
67
Views
14K
Replies
1
Views
3K
Back
Top