42
Chap2 Image enhancement (Spatial domain)

Image Enhancement

  • Upload
    ksb9790

  • View
    14

  • Download
    3

Embed Size (px)

DESCRIPTION

Image Enhancement

Citation preview

  • Chap2 Image enhancement (Spatial domain)

  • PreprocessingWhy we need image enhancement?Un-necessary noisesDefects caused by image acquisitionUneven illumination: non-uniform Lens: blurring object or backgroundMotion : blurring Distortion: geometric distortion caused by lensregistration

  • Chapter 2Image Enhancement in theSpatial Domain2.1 BackgroundSpecific applicationproblem orientedTrial and error is necessarySpatial domain will be denoted by the expression g(x,y)=T[f(x,y)]The simplest form of T: s=T(r) Contrast stretching: (Fig. 3.2 (a))Thresholding function: binary image (Fig. 3.2)Masks (filters, kernels, templates, windows)Enhancement : mask processing or filtering

    2.2 Some gray level transformationsThree basic types of functions used for image enhancementLinearlogarithmicPower-law

  • 2.2.1 Image negativesIs obtained by using the negative transformation s=L-1-rProduces the equivalent of a photographic negativeSuited for enhancing white or gray detail embedded in dark regions of an image

    2.2.2 Log transformationsThe general form of the log transformation : s=clog(1+r)Expand the values of dark pixels while compressing the high-level valuesCompress the dynamic range of images with large variations

    2.2.3 Power-law transformationThe basic form:Gamma correctionCRT device have an intensity-to-voltage response that is a power functionProduce images that are darker than intendedIs important if displaying an image accurately on a computer screen

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 2Image Enhancement in theSpatial Domain

  • Chapter 2Image Enhancement in theSpatial Domain

  • Chapter 2Image Enhancement in theSpatial Domain

  • Chapter 2Image Enhancement in theSpatial Domain

  • Low r: wash-out in the background (Fig. 3.8 r=0.3)High r: enhance a wash-out appearance (Fig. 3.9 r=0.5 areas are too dark)

    2.2.4 Piecewise-linear transformation functionsAdvantage: the form of piecewise functions can be arbitrary complex over the previous functions Disadvantage: require considerably more user inputContrast stretching One of the simplest piecewise functionIncrease the dynamic range of the gray levels in the imageA typical transformation: control the shape of the transformationr1=r2 s1=0 and s2=L-1Gray level slicing Highlight a specific range of gray levels Display a high value for all gray levels in the range of interest and a low value for all other gray levels : produce a binary image

  • ContinueBrighten the desired range of gray levels, but preserves the background and gray level tonalities (Fig. 3.11)The higher order bits (especially the top four) contain the majority of the visually significant data

  • Chapter 2Image Enhancement in theSpatial Domain

  • Chapter 2Image Enhancement in theSpatial Domain

  • Chapter 2Image Enhancement in theSpatial Domain

  • Chapter 2Image Enhancement in theSpatial Domain

  • 2.3 Histogram processing Histogram of a digital image with the gray levels in the range[0, L-1]Low contrast: a narrow histogram, a dull, wash-out gray lookHigh contrast : cover a broader range of the gray scale and the distribution of pixels is not too far uniform, with very few vertical lines being much higher than the others A great deal of details and high dynamic range

    2.3.1 Histogram equalizationHistogram of S=T (r) 0 r1produce a level s for every pixel value in the original image, the transformation satisfies the following conditions:

    (1) T(r) is single-valued and monotonically increasing in the interval 0 r 1; and (2) 0 T ( r ) 1 for 0 r 1r=T-1(s) 0 s 1

  • Chapter 2Image Enhancement in theSpatial Domain

  • Chapter 2Image Enhancement in theSpatial Domain

  • 3.4 Enhancement using arithmetic/logic operationsImage subtraction g(x,y)=f(x,y)-h(x,y)Masking is referred to as ROI (region of interest) processingIsolate an area for processingArithmetic operationsAddition:Subtraction: Multiplication: used to implement gray-level rather than binaryDivision:Logic operationsAnd: used for masking (Fig. 3.27)Or:used for maskingNot operation: negative transformationAlso are used in conjunction with morphological operations

  • Chapter 3Image Enhancement in theSpatial Domain

  • 2.4.1 Image subtractionThe difference between two images f(x,y) and h(x,y) is expressed as g(x,y)=f(x,y)-h(x,y)Enhance the difference part of two imagesContrast stretching transformationuseful for evaluating the effect of setting to zero the lower-order planes (Fig. 3.28(d))Mask mode radiography (Fig 3.29)Sort of scaling : solve image values outside form the range 0 to 255 (-255 to 255)(1) Add 255 to every pixel and divide by 2: fast and simple to implement, but the full rang of the display may not be used(2) more accuracy and full coverage of the 8-it rangeThe values of the minimum difference is obtained and its negative added to all the pixels in the difference imageAll the pixels in the image are scaled to [0,255] by multiplying 255/Max

    2.4.2 Image averaging g(x,y)=f(x,y)+(x,y) (assume every pair of coordinates (x,y) the noise is uncorrelated and has zero average value)

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • Reduce the noise content by adding a set of noise images {gi(x,y)} An image is formed by averaging K different noisy imagesAs k increases, the variability of the pixel values at each location (x,y) decreasesThe image gi(x,y) must be registered in order to avoid the introduction of blurringUse integrating capabilities of CCD or similar sensors for noise reduction by observing the same scene over long periods of time

    3.5 Basics of spatial filteringSub-image: (filter, mask, kernel, template or window)Frequency domain:Spatial domainLinear spatial filtering: is give by a sum of products of the filter coefficients R=In general, linear filtering of an image with a filter mask of size MxN is given by g(x,y)Convolving a mask with an image by pixel-by-pixel basis

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • Used for blurring and for noise reductionBlurring is used for removal of detail and bridging of small gaps in lines or curves

    2.6.1 Smoothing linear filters Averaging filter (low pass filter)Replace the value of every pixel by the average of the gray levels in the neighborhood by the filter maskReduce sharp transition (such as random noise)Blur edgesThe average of the gray levels in the 3x3 neighborhoodsAveraging with limited data validityonly to pixels in the original image in a pre-defined interval of invalid dataOnly if the computed brightness change of a pixel is in some pre-defined interval

    2.6 Smoothing spatial filters

  • Averaging according to inverse gradient=Averaging using a rotation mask

    2.6.2 Order Statistics filters (rank filters)Nonlinear spatial filter based on ordering (ranking)Median filter Remove impulse noises (salt and pepper noises)Represent 50 percent of a ranked setLarge clusters are affected considerably lessMin filterMax filter--useful in finding the brightest points Non-linear mean filter Arithmetic meanHarmonic meanGeometric mean

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • 3.7 Sharpening spatial filterHighlight fine detail or enhance detailEnhance detail that has been blurredApplication ranging from electronic printing and medical imaging to industrial inspectionCan be accomplished by digital differentiation

    3.7.1 FoundationSharpening filter based on first- and second-order derivativesDefinition for first derivativesMust be zero in flat segmentMuse be nonzero at the onset of a gray level step or rampMust be nonzero along rampsDef. of first derivate: Produce thick edges Has a strong response to gray-level step

  • Definition for second derivatives: is better suited than the first-derivative for image enhancementMust be zero in flat areasMuse be nonzero at the onset and end of a gray level step or rampMust be zero along ramps of constant slopeDef. Of a second order derivate:Produces finer edgesEnhance fine detail much more than a first order derivate for example: a thin lineThe stronger response at an isolated pointHas a transition form positive back to negativeProduces a double response to a gray-level stepHighlight the fundamental similarities and differences between first- and second- order derivatives (Fig. 3.38)

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • Chapter 3Image Enhancement in theSpatial Domain

  • Approximate the magnitude of the gradient by using absolute valuesLost isotropic feature propertyVertical and horizontal edges preserve the isotropic properties only for multiples of 90Mask of odd sizesRobert operatorRobert Ross-gradient operatorsAn approximation using absolute values (3.7-18)Sobel operatorUse a weight value of 2 to achieve some smoothing by giving more importance to the center pointConstant or slowly varying shades are eliminatedPrewitt operator