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

In summary, the histograms will be different after the filter is applied. The filter gets applied at the edge of the image, and the only way to see the intensity value along the edge is if the filter is able to "hang off" the edge.
  • #1
Master1022
611
117
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:
[tex]
\frac{1}{9} \cdot \begin{pmatrix}
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1
\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.
 
Physics news on Phys.org
  • #2
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
  • #3
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!
 

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

1. What is a histogram in image processing?

A histogram in image processing is a graphical representation of the distribution of pixel intensity values in an image. It shows the frequency of each intensity value and can help analyze the contrast and brightness of an image.

2. How is a histogram used in image processing?

A histogram is used in image processing to visualize the distribution of pixel intensity values and to make adjustments to the image's contrast and brightness. It can also help identify any under or overexposed areas in an image.

3. What is the difference between a grayscale and color histogram?

A grayscale histogram shows the distribution of pixel intensity values in a grayscale image, while a color histogram shows the distribution of RGB (red, green, blue) values in a color image. A color histogram can be used to analyze the color balance and saturation of an image.

4. Can a histogram be used to enhance an image?

Yes, a histogram can be used to enhance an image by adjusting the contrast and brightness levels. By stretching or compressing the histogram, the overall tonal range of the image can be improved, resulting in a more visually appealing image.

5. Are there any limitations to using histograms in image processing?

While histograms are a useful tool in image processing, they do have some limitations. They only show the distribution of pixel intensity values and do not take into account spatial information. Additionally, histograms may not accurately represent the visual appearance of an image, as they are based on mathematical calculations.

Similar threads

  • General Discussion
Replies
2
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
5K
  • Math Proof Training and Practice
2
Replies
48
Views
8K
  • Math Proof Training and Practice
6
Replies
175
Views
20K
  • Math Proof Training and Practice
2
Replies
67
Views
10K
Replies
2
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Replies
4
Views
8K
Back
Top