《《调色盘操作实例》PPT课件.ppt》由会员分享,可在线阅读,更多相关《《调色盘操作实例》PPT课件.ppt(36页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Chapter 3Image Enhancementin the Spatial Domain(Part C)Image Processing,Department of Information Management,Leader University139下书网提供大量行业资料,电子书,电脑教程下载下书网提供大量行业资料,电子书,电脑教程下载Digital Image Processing,2nd ed.Dig
2、ital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods 調色盤操作實例假設有一3x3的圖形,使用的是8階的RGB色彩機制,且該圖形內容及調色盤如下:NoRGB00001234254236504711512262337247Gray03453234Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods 修正後的結果NoRGB00001111222233334444555566667777Digital Image
3、 Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Histogram EqualizationAutomatically determines a transformation function that seeks to produce an output image that has a uniform histogram.When the uniform histogram is not the best approach,we may try the Histogram Matc
4、hing or Histogram Specification.Histogram Matching allows us to specify the shape of the histogram.Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Histogram Matching(Specification)The histogram equalization automatically determines a transformation functio
5、n that seeks to produce an output image that has a uniform histogram.The method used to generate a processed image that has a specified histogram is called histogram matching or histogram specification.Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Histog
6、ram MatchingDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Some Useful PDFs of pz(z)Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Specified PDF Obtaining Procedures1)Obtain the transformation function T(r)usin
7、g Eq.(3.3-10).2)Use Eq.(3.3.11)to obtain the transformation function G(z).3)Obtain the inverse transformation function G-1.4)Obtain the output image by applying Eq.(3.3-12)to all the pixels in the input image.uThe result of this procedure will be an image whose gray levels,z,have the specified proba
8、bility density function pz(z)Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Discrete VersionDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Implementation Details1)Each set of gray levels rj,sj,and zj,j=0,1,2,L-
9、1,is one-dimensional array of dimension Lx1.2)All mappings from r to s and from s to z are simple table lookups between a given pixel value and these arrays.3)Each of the elements of these arrays,for example,sk,contains two important pieces of information:The subscript k denotes the location of the
10、element in the array,and s denotes the value at that location.4)We need to be concerned only with integer pixel values.Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Histogram MatchingDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.
11、C.Gonzalez&R.E.Woods Procedures for Histogram Matching1)Obtain the histogram of the given image.2)Use Eq.(3.3-13)to precompute a mapped level sk fro each level rk.3)Obtain the transformation function G from the given pz(z)using Eq.(3.3-14).4)Precompute zk for each value of sk using the iterative sch
12、eme defined in connection with Eq.(3.3-17).5)For each pixel in the original image,if the value of that pixel is rk,map this value to its corresponding level sk;then map level sk into the final level zk.Use the precomputed values from Steps(2)and(4)for these mappings.uStep(5)implements two mappings.T
13、he first mapping is nothing more than histogram equalization.Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Original ImageDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Fail to Histogram EqualizationSince the p
14、roblem with the transformationfunction in Fig.3.21(a)was caused by a large concentration of pixels in the originalimage with levels near 0.Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Good Result by Histogram Matching MethodManuallyspecifiedfunctionG(z)
15、G-1(z)Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Discussion of Histogram MatchingHistogram specification is a trial-and-error process.In general,there are no rules for specifying histograms,and one must resort to analysis on a case-by-case basis for a
16、ny given enhancement task.Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Local EnhancementThe histogram equalization and histogram matching is the global processing,that is,the pixels are modified by a transformation function based on the gray-level conte
17、nt of an entire image.It is also necessary to enhance details over small areas in an image.The solution is to devise transformation functions based on the gray-level distribution in the neighborhood of every pixel in the image.Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.
18、Gonzalez&R.E.Woods Local Enhancement ExampleDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Use of Histogram StatisticsThe nth moment of r about its mean is defined as:Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Wo
19、ods Mean and VarianceMeana measure of average gray level in an image.Variance or Standard deviationa measure o average contrast.Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods The Use of Mean and VarianceThe global mean and variance are measured over an en
20、tire image and are useful primarily for gross adjustments of overall intensity and contrast.The local mean and variance are used as the basis for making changes that depend on image characteristics in a predefined region about each pixel in the image.Digital Image Processing,2nd ed.Digital Image Pro
21、cessing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Local Mean and VarianceLet(x,y)be the coordinates of a pixel in an image,and let Sxy denote a neighborhood(subimage)of specified size,centered at(x,y).Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Original Image
22、Not obvious!Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Mean and Variance ProcessingDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Acceptable ResultUndesired effect!Digital Image Processing,2nd ed.Digital Im
23、age Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Arithmetic/Logic Operationsbetween Two ImagesArithmetic/logic operations involving images are performed on a pixel-by pixel basis between two or more images.Arithmetic operationsAddition,Subtraction,MultiplicationLogic operationsAND,OR,NOTDigital Ima
24、ge Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Enhancement Using Arithmetic/Logic OperationsDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Image SubtractionThe key usefulness of subtraction is the enhancement of differenc
25、e between images.The results have to be limited into the gray level range 0.L-1.In tracking moving vehicles in a sequence of images,subtraction is used to remove all stationary components in an image.Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Image Su
26、btractionDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Image SubtractionDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Image AveragingA noisy image g(x,y)can be defined asDigital Image Processing,2nd ed.Digita
27、l Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Example for Image AveragingDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Image AveragingDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Basic of Spatial Fil
28、teringSome neighborhood operations work with the values of the image pixels in the neighborhood and the corresponding values of a subimage that has the same dimensions as the neighbor.The subimage is called filter,mask,kernel,template,or window.The value in a filter subimage are referred to coefficientsDigital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Digital Image Processing,2nd ed.Digital Image Processing,2nd ed.2002 R.C.Gonzalez&R.E.Woods Basics of Spatial Filtering