Presentation is loading. Please wait.

Presentation is loading. Please wait.

MSU CSE 803 Stockman Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute.

Similar presentations


Presentation on theme: "MSU CSE 803 Stockman Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute."— Presentation transcript:

1 MSU CSE 803 Stockman Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute some result at that pixel

2 MSU CSE 803 Stockman Expressing linear operations on neighborhoods

3 MSU CSE 803 Stockman Images as functions

4 MSU CSE 803 Stockman Neighborhood operations Average neighborhood to remove noise or high frequency patterns Detect boundaries at points of contrast using gradient computation Can use median filtering to smooth while keeping boundaries sharp

5 MSU CSE 803 Stockman Image processing examples Histogram equalization; gamma correction; median filtering

6 MSU CSE 803 Stockman Histogram equalization Left image does not use all available gray levels. Image is recoded so that all gray levels are used and such that each gray level occurs in roughly the same number of pixels of the recoded image. (See algorithm in text, xv.)

7 MSU CSE 803 Stockman Histogram equalization can darken a bright image, perhaps improving contrast

8 MSU CSE 803 Stockman Can define mapping of input gray level to output level (xv) Gamma correction: boost all gray levels Boost low levels and reduce high

9 MSU CSE 803 Stockman Smoothing an image by averaging neighbors (boxcar)

10 MSU CSE 803 Stockman Output pixel is the dot product of the input neighborhood and the mask

11 MSU CSE 803 Stockman Properties of smoothing masks

12 MSU CSE 803 Stockman Types of ideal edges (in 1D) These types are also present in 2D and 3D images and are complicated by orientation variations.

13 MSU CSE 803 Stockman Boxcar smoothing filter example So, reducing noise will also degrade the signal.

14 MSU CSE 803 Stockman Linear smoothing smoothes noise and blurs signal Blur: step is now ramp Input imageRow after 5x5 mean filter

15 MSU CSE 803 Stockman Gaussian smoothing

16 MSU CSE 803 Stockman Median filter replaces center with neighborhood median, not mean Noisy row of checkers image Mean filtering smoothes signal and ramps the boundary Median filter smoothes signal and preserves sharp boundary

17 MSU CSE 803 Stockman Median filter is not linear Algorithm requires comparisons and is more expensive than using mask Can sort all NxN pixel values and pick middle Do not need totally sorted data: O(N) algorithm exists

18 MSU CSE 803 Stockman Scratches removed by using a median filter Thin artifact removed, sharp boundaries preserved.

19 MSU CSE 803 Stockman Finding boundary pixels Computing derivatives or gradients to locate region change.

20 MSU CSE 803 Stockman Differencing used to estimate 1 st and 2 nd derivatives First differences 2 nd differences Masks represent the first and 2 nd differences

21 MSU CSE 803 Stockman Step edges X mask [-1, 0, +1] Step edge is detected well, but edge location imprecise.

22 MSU CSE 803 Stockman Ramp and impulse X mask [-1, 0, +1] Ramp edge now yields a broad weak response. Impulse response is a “whip”, first up and then down.

23 MSU CSE 803 Stockman 2 nd derivative using mask [-1, 2, -1] Response is zero on constant region and a “double whip” amplifies and locates the step edge.

24 MSU CSE 803 Stockman 2 nd derivative using mask [-1, 2, -1] Weak response brackets the ramp edge. Bright impulse yields a double whip with gain of 3X original contrast.

25 MSU CSE 803 Stockman Estimating 2D image gradient

26 MSU CSE 803 Stockman Gradient from 3x3 neighborhood Estimate both magnitude and direction of the edge.

27 MSU CSE 803 Stockman Prewitt versus Sobel masks Sobel mask uses weights of 1,2,1 and -1,-2,-1 in order to give more weight to center estimate. The scaling factor is thus 1/8 and not 1/6.

28 MSU CSE 803 Stockman Computational short cuts

29 MSU CSE 803 Stockman Alternative masks for gradient

30 MSU CSE 803 Stockman Computational shortcuts Use MAX operation on 1D row and column derivatives. Use OR operation on thresholded row and column derivatives.

31 MSU CSE 803 Stockman 2 rows of intensity vs difference

32 MSU CSE 803 Stockman Caption for Prewitt image

33 MSU CSE 803 Stockman Properties of derivative masks

34 MSU CSE 803 Stockman Next set of related slides Interpret the properties of masks using the theory of vectors and dot products.


Download ppt "MSU CSE 803 Stockman Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute."

Similar presentations


Ads by Google