数字图像处理英文版
- 格式:ppt
- 大小:8.33 MB
- 文档页数:118
第 1 页中英文对照资料外文翻译文献原 文To image edge examination algorithm researchAbstract :Digital image processing took a relative quite young discipline,is following the computer technology rapid development, day by day obtains th widespread application.The edge took the image one kind of basic characteristic,in the pattern recognition, the image division, the image intensification as well as the image compression and so on in the domain has a more widesp application.Image edge detection method many and varied, in which based on brightness algorithm, is studies the time to be most long, the theory develo the maturest method, it mainly is through some difference operator, calculates its gradient based on image brightness the change, thus examines the edge, mainlyhas Robert, Laplacian, Sobel, Canny, operators and so on LOG 。
•Lecturer:–盛蕴–Tel: 54345185–Email: ysheng@–Addr.: 华东师范大学闵行校区信息楼612室•Aims–To understand Digital Image Processing (DIP) and its relevant algorithms, which serve as basis of many other applications.–To be able to implement these DIP algorithms with MATLAB. •Assignments: N•Assessment–Assignment + Final Design(?)–60% + 40% or 100%1.《数字图像处理数字图像处理((第3版)()(英文版英文版英文版)》,)》,)》,Rafael C. Gonzalez & Richard E. Woods Rafael C. Gonzalez & Richard E. Woods著,电子工业出版社电子工业出版社201020102010年影印年影印年影印。
2.《数字图像处理数字图像处理((MATLAB MATLAB版版)()(英文版英文版英文版)》,)》,)》,Rafael C. Gonzalez & Richard E. Woods Rafael C. Gonzalez & Richard E. Woods著,电子工业出版社电子工业出版社200920092009年影印年影印年影印。
English = Kit ?•Digital image fundamentals (4 hrs)•Image enhancement in spatial domain (6 hrs)•Image enhancement in frequency domain (6hrs)•Image restoration (4hrs)•Colour image processing (4hrs)•Wavelet and multiresolution processing (6 hrs)•Image compression (6 hrs)•Digital Image Fundamentals–History and applications of digital image processing –Fundamental steps in digital image processing–Elements of visual perception–Light and the electromagnetic spectrum–Image sensing and acquisition–Image sampling and quantization–Some basic relationships between pixels•One picture is worth more than ten thousand words•无图无真相xyf (x, y )•Picture element/image element/Pixel /Pels •Intensity /Gray Level•The field of Digital Image Processing(DIP) refers to processing digital images by means of a digital computer.•Distinction among–DIP–Image Analysis–Computer Vision•Three types of computerised processes–Low-level process–Mid-level process–High-level process•DIP defined by our textbook•First application of DIPwas the picture sent by the Bartlane cable picture transmission system through submarine cable between London & NY in the early 1920s.out meaningful DIP wasduring the spaceprogramme in the early1960s.•By a US spacecraft Ranger7 in 1964.•Gamma-rays (Positron Emission Tomography)•X-rays (Computerised Tomography)•Ultraviolet band•Visible and infrared bands•Microwaves (Radar)•Radio waves (MRI)•Others (Ultrasound)λ= c/v E = hvwhere λand v are wavelength and frequency, respectively. c is the speed of light, hindicates Planck’s constant.•Most of the images in which we are interested are generated by the combination of an “illumination”source and the reflection or absorption of energy from that source by the elements of the “scene”being imaged.Image Sampling & Quantisation•Digitising the coordinate values is called sampling. •Digitising the amplitude value is called quantisation.Image Sampling & QuantisationNM•The number of intensity level L = 2k •The number of bits required to store a digitised image b=M×N×kImage Sampling & Quantisation• Spatial resolution– Line pairs per unit distance – Dots (pixels) per unit distance e.g. 4800 dpi – Measures of spatial resolution must be stated with respect to spatial units.• Intensity resolution L = 2kImage Sampling & QuantisationImage Sampling & QuantisationImage Sampling & QuantisationImage Interpolation• Interpolation– A process of using known data to estimate values at unknown locations. – Used in scaling, zooming, shrinking, transforming and geometric correction etc. – Nearest neighbour interpolation, bilinear interpolation, bicubic interpolation etc.Image InterpolationBicubic InterpolationBilinear InterpolationImage InterpolationNeighbours of a pixel• 4-neighbours of p: N4(p)p• Diagonal neighbours: ND(p)p•8-neighbors = 4-neighbours+diagonal neighbours : N8(p)。
3HistogramsHistograms are used to depict image statistics in an easily interpreted visual format.With a histogram,it is easy to determine certain types of problems in an image,for example,it is simple to conclude if an image is properly exposed by visual inspection of its histogram.In fact,histograms are so useful that modern digital cameras often provide a real-time histogram overlay on the viewfinder(Fig.3.1)to help prevent taking poorly exposed pictures.It is important to catch errors like this at the image capture stage because poor exposure results in a permanent loss of information which it is not possible to recover later using image-processing techniques.In addition to their usefulness during image capture,histograms are also used later to improve the visual appearance of an image and as a“forensic”tool for determining what type of processing has previously been applied to an image.3.1What Is a Histogram?Histograms in general are frequency distributions,and histograms of images describe the frequency of the intensity values that occur in an image.This concept can be easily explained by considering an old-fashioned grayscale image like the one shown in Fig.3.2.A histogram h for a grayscale image I with intensity values in the range I(u,v)∈[0,K−1]would contain exactly K entries, where for a typical8bit grayscale image,K=28=256.Each individual histogram entry is defined ash(i)=the number of pixels in I with the intensity value i,W. Burger, M.J. Burge, Principles of Digital Image Processing, Undergraduate Topicsin Computer Science, DOI 10.1007/978-1-84800-191-6_3, Springer-Verlag London Limited, 2009©38 3.HistogramsFigure 3.1Digital camera back display showing a histogram overlay.Figure 3.2An 8-bit grayscale image and a histogram depicting the frequency distribution of its 256intensity values.for all 0≤i <K .More formally stated,h (i )=card (u,v )|I (u,v )=i .1(3.1)Therefore h (0)is the number of pixels with the value 0,h (1)the number of pixels with the value 1,and so forth.Finally h (255)is the number of all white pixels with the maximum intensity value 255=K −1.The result of the histogram computation is a one-dimensional vector h of length K .Figure 3.3gives an example for an image with K =16possible intensity values.Since a histogram encodes no information about where each of its individ-ual entries originated in the image,histograms contain no information about the spatial arrangement of pixels in the image.This is intentional since the 1card {...}denotes the number of elements (“cardinality”)in a set (see also p.233).3.2Interpreting Histograms 390123456789101112131415i i h (i h (i )Figure3.3Histogram vector for an image with K =16possible intensity values.The indices of the vector element i =0...15represent intensity values.The value of 10at index 2means that the image contains 10pixels of intensity value 2.Figure 3.4Three very different images with identical histograms.main function of a histogram is to provide statistical information,(e.g.,the distribution of intensity values)in a compact form.Is it possible to reconstruct an image using only its histogram?That is,can a histogram be somehow “in-verted”?Given the loss of spatial information,in all but the most trivial cases,the answer is no.As an example,consider the wide variety of images you could construct using the same number of pixels of a specific value.These images would appear different but have exactly the same histogram (Fig.3.4).3.2Interpreting HistogramsA histogram depicts problems that originate during image acquisition,such as those involving contrast and dynamic range,as well as artifacts resulting from image-processing steps that were applied to the image.Histograms are often used to determine if an image is making effective use of its intensity range (Fig.3.5)by examining the size and uniformity of the histogram’s distribution.40 3.HistogramsFigure3.5The effective intensity range.The graph depicts how often a pixel value occurs linearly(black bars)and logarithmically(gray bars).The logarithmic form makes even relatively low occurrences,which can be very important in the image,readily apparent. 3.2.1Image AcquisitionExposureHistograms make classic exposure problems readily apparent.As an example,a histogram where a large span of the intensity range at one end is largely unused while the other end is crowded with high-value peaks(Fig.3.6)is representative of an improperly exposed image.(a)(b)(c)Figure3.6Exposure errors are readily apparent in histograms.Underexposed(a),properly exposed(b),and overexposed(c)photographs.3.2Interpreting Histograms41(a)(b)(c)Figure 3.7How changes in contrast affect a histogram:low contrast(a),normal con-trast(b),high contrast(c).ContrastContrast is understood as the range of intensity values effectively used within a given image,that is the difference between the image’s maximum and minimum pixel values.A full-contrast image makes effective use of the entire range of available intensity values from a=a min...a max=0...K−1(black to white).Using this definition,image contrast can be easily read directly from the histogram.Figure3.7illustrates how varying the contrast of an image affects its histogram.Dynamic rangeThe dynamic range of an image is,in principle,understood as the number of distinct pixel values in an image.In the ideal case,the dynamic range encom-passes all K usable pixel values,in which case the value range is completely utilized.When an image has an available range of contrast a=a low...a high, witha min<a low and a high<a max,then the maximum possible dynamic range is achieved when all the intensity values lying in this range are utilized(i.e.,appear in the image;Fig.3.8).While the contrast of an image can be increased by transforming its existing values so that they utilize more of the underlying value range available,the dy-42 3.Histograms(a)(b)(c)Figure3.8How changes in dynamic range affect a histogram:high dynamic range(a), low dynamic range with64intensity values(b),extremely low dynamic range with only6 intensity values(c).namic range of an image can only be increased by introducing artificial(that is, not originating with the image sensor)values using methods such as interpola-tion(see Vol.2[6,Sec.10.3]).An image with a high dynamic range is desirable because it will suffer less image-quality degradation during image processing and compression.Since it is not possible to increase dynamic range after im-age acquisition in a practical way,professional cameras and scanners work at depths of more than8bits,often12–14bits per channel,in order to provide high dynamic range at the acquisition stage.While most output devices,such as monitors and printers,are unable to actually reproduce more than256dif-ferent shades,a high dynamic range is always beneficial for subsequent image processing or archiving.3.2.2Image DefectsHistograms can be used to detect a wide range of image defects that originate either during image acquisition or as the result of later image processing.Since histograms always depend on the visual characteristics of the scene captured in the image,no single“ideal”histogram exists.While a given histogram may be optimal for a specific scene,it may be entirely unacceptable for another. As an example,the ideal histogram for an astronomical image would likely be very different from that of a good landscape or portrait photo.Nevertheless,3.2Interpreting Histograms43 there are some general rules;for example,when taking a landscape image with a digital camera,you can expect the histogram to have evenly distributed intensity values and no isolated spikes.SaturationIdeally the contrast range of a sensor,such as that used in a camera,should be greater than the range of the intensity of the light that it receives from a scene. In such a case,the resulting histogram will be smooth at both ends because the light received from the very bright and the very dark parts of the scene will be less than the light received from the other parts of the scene.Unfortunately, this ideal is often not the case in reality,and illumination outside of the sensor’s contrast range,arising for example from glossy highlights and especially dark parts of the scene,cannot be captured and is lost.The result is a histogram that is saturated at one or both ends of its range.The illumination values lying outside of the sensor’s range are mapped to its minimum or maximum values and appear on the histogram as significant spikes at the tail ends.This typically occurs in an under-or overexposed image and is generally not avoidable when the inherent contrast range of the scene exceeds the range of the system’s sensor (Fig.3.9(a)).(a)(b)(c)Figure3.9Effect of image capture errors on histograms:saturation of high intensities(a), histogram gaps caused by a slight increase in contrast(b),and histogram spikes resulting from a reduction in contrast(c).Spikes and gapsAs discussed above,the intensity value distribution for an unprocessed image is generally smooth;that is,it is unlikely that isolated spikes(except for possible44 3.Histograms saturation effects at the tails)or gaps will appear in its histogram.It is also unlikely that the count of any given intensity value will differ greatly from that of its neighbors(i.e.,it is locally smooth).While artifacts like these are ob-served very rarely in original images,they will often be present after an image has been manipulated,for instance,by changing its contrast.Increasing the contrast(see Ch.4)causes the histogram lines to separate from each other and, due to the discrete values,gaps are created in the histogram(Fig.3.9(b)).De-creasing the contrast leads,again because of the discrete values,to the merging of values that were previously distinct.This results in increases in the corre-sponding histogram entries and ultimately leads to highly visible spikes in the histogram(Fig.3.9(c)).2Impacts of image compressionImage compression also changes an image in ways that are immediately evident in its histogram.As an example,during GIF compression,an image’s dynamic range is reduced to only a few intensities or colors,resulting in an obvious line structure in the histogram that cannot be removed by subsequent processing (Fig.3.10).Generally,a histogram can quickly reveal whether an image has ever been subjected to color quantization,such as occurs during conversion to a GIF image,even if the image has subsequently been converted to a full-color format such as TIFF or JPEG.Figure3.11illustrates what occurs when a simple line graphic with only two gray values(128,255)is subjected to a compression method such as JPEG, that is not designed for line graphics but instead for natural photographs.The histogram of the resulting image clearly shows that it now contains a large number of gray values that were not present in the original image,resulting ina poor-quality image3that appears dirty,fuzzy,and blurred.3.3Computing HistogramsComputing the histogram of an8-bit grayscale image containing intensity val-ues between0and255is a simple task.All we need is a set of256counters, one for each possible intensity value.First,all counters are initialized to zero. 2Unfortunately,these types of errors are also caused by the internal contrast“opti-mization”routines of some image-capture devices,especially consumer-type scan-ners.3Using JPEG compression on images like this,for which it was not designed,is one of the most egregious of imaging errors.JPEG is designed for photographs of natural scenes with smooth color transitions,and using it to compress iconic images with large areas of the same color results in strong visual artifacts(see,for example,Fig.1.9on p.19).3.3Computing Histograms45(a)(b)(c)Figure3.10Color quantization effects resulting from GIF conversion.The original image converted to a256color GIF image(left).Original histogram(a)and the histogram after GIF conversion(b).When the RGB image is scaled by50%,some of the lost colors are recreated by interpolation,but the results of the GIF conversion remain clearly visible in the histogram(c).(a)(b)(c)(d)Figure 3.11Effects of JPEG compression.The original image(a)contained only two different gray values,as its histogram(b)makes readily apparent.JPEG compression,a poor choice for this type of image,results in numerous additional gray values,which are visible in both the resulting image(c)and its histogram(d).In both histograms,the linear frequency(black bars)and the logarithmic frequency(gray bars)are shown.46 3.Histograms 1public class Compute_Histogram implements PlugInFilter{23public int setup(String arg,ImagePlus img){4return DOES_8G+NO_CHANGES;5}67public void run(ImageProcessor ip){8int[]H=new int[256];//histogram array9int w=ip.getWidth();10int h=ip.getHeight();1112for(int v=0;v<h;v++){13for(int u=0;u<w;u++){14int i=ip.getPixel(u,v);15H[i]=H[i]+1;16}17}18...//histogram H[]can now be used19}2021}//end of class Compute_HistogramProgram3.1ImageJ plugin for computing the histogram of an8-bit grayscale image.The setup()method returns DOES_8G+NO_CHANGES,which indicates that this plugin requires an8-bit grayscale image and will not alter it(line4).In Java,all elements of a newly instantiated array(line8)are automatically initialized,in this case to zero.Then we iterate through the image I,determining the pixel value p at each location(u,v),and incrementing the corresponding counter by one.At the end,each counter will contain the number of pixels in the image that have the corresponding intensity value.An image with K possible intensity values requires exactly K counter vari-ables;for example,since an8-bit grayscale image can contain at most256 different intensity values,we require256counters.While individual counters make sense conceptually,an actual implementation would not use K individ-ual variables to represent the counters but instead would use an array with K entries(int[256]in Java).In this example,the actual implementation as an array is straightforward.Since the intensity values begin at zero(like arrays in Java)and are all positive,they can be used directly as the indices i∈[0,N−1] of the histogram array.Program3.1contains the complete Java source code for computing a histogram within the run()method of an ImageJ plugin.At the start of Prog.3.1,the array H of type int[]is created(line8)and its elements are automatically initialized4to0.It makes no difference,at least in terms of thefinal result,whether the array is traversed in row or column 4In Java,arrays of primitives such as int,double are initialized at creation to0in the case of integer types or0.0forfloating-point types,while arrays of objects are initialized to null.3.4Histograms of Images with More than8Bits47 order,as long as all pixels in the image are visited exactly once.In contrast to Prog.2.1,in this example we traverse the array in the standard row-first order such that the outer for loop iterates over the vertical coordinates v and the inner loop over the horizontal coordinates u.5Once the histogram has been calculated,it is available for further processing steps or for being displayed.Of course,histogram computation is already implemented in ImageJ and is available via the method getHistogram()for objects of the class Image-Processor.If we use this built-in method,the run()method of Prog.3.1can be simplified topublic void run(ImageProcessor ip){int[]H=ip.getHistogram();//built-in ImageJ method...//histogram H[]can now be used}3.4Histograms of Images with More than8Bits Normally histograms are computed in order to visualize the image’s distribution on the screen.This presents no problem when dealing with images having 28=256entries,but when an image uses a larger range of values,for instance 16-and32-bit orfloating-point images(see Table1.1),then the growing number of necessary histogram entries makes this no longer practical.3.4.1BinningSince it is not possible to represent each intensity value with its own entry in the histogram,we will instead let a given entry in the histogram represent a range of intensity values.This technique is often referred to as“binning”since you can visualize it as collecting a range of pixel values in a container such as a bin or bucket.In a binned histogram of size B,each bin h(j)contains the number of image elements having values within the interval a j≤a<a j+1, and therefore(analogous to Eqn.(3.1))h(j)=card{(u,v)|a j≤I(u,v)<a j+1},for0≤j<B.(3.2) Typically the range of possible values in B is divided into bins of equal size k B=K/B such that the starting value of the interval j isa j=j·KB=j·k B.5In this way,image elements are traversed in exactly the same way that they are laid out in computer memory,resulting in more efficient memory access and with it the possibility of increased performance,especially when dealing with larger images (see also Appendix B,p.242).48 3.Histograms3.4.2ExampleIn order to create a typical histogram containing B =256entries from a 14-bitimage,you would divide the available value range if j =0...214−1into 256equal intervals,each of length k B =214/256=64,so that a 0=0,a 1=64,a 2=128,...a 255=16,320and a 256=a B =214=16,384=K .This results in the following mapping from the pixel values to the histogram bins h (0)...h (255):h (0)←0≤I (u,v )<64h (1)←64≤I (u,v )<128h (2)←128≤I (u,v )<192............h (j )←a j ≤I (u,v )<a j +1............h (255)←16320≤I (u,v )<163843.4.3ImplementationIf,as in the above example,the value range 0...K −1is divided into equal length intervals k B =K/B ,there is naturally no need to use a mapping table to find a j since for a given pixel value a =I (u,v )the correct histogram element j is easily computed.In this case,it is enough to simply divide the pixel value I (u,v )by the interval length k B ;that is,I (u,v )k B =I (u,v )K/B =I (u,v )·B K .(3.3)As an index to the appropriate histogram bin h (j ),we require an integer valuej = I (u,v )·B K,(3.4)where · denotes the floor function.6A Java method for computing histograms by “linear binning”is given in Prog.3.2.Note that all the computations from Eqn.(3.4)are done with integer numbers without using any floating-point op-erations.Also there is no need to explicitly call the floor function because the expressiona *B /Kin line 11uses integer division and in Java the fractional result of such an oper-ation is truncated,which is equivalent to applying the floor function (assuming3.5Color Image Histograms49 1int[]binnedHistogram(ImageProcessor ip){2int K=256;//number of intensity values3int B=32;//size of histogram,must be defined4int[]H=new int[B];//histogram array5int w=ip.getWidth();6int h=ip.getHeight();78for(int v=0;v<h;v++){9for(int u=0;u<w;u++){10int a=ip.getPixel(u,v);11int i=a*B/K;//integer operations only!12H[i]=H[i]+1;13}14}15//return binned histogram16return H;17}Program3.2Histogram computation using“binning”(Java method).Example of comput-ing a histogram with B=32bins for an8-bit grayscale image with K=256intensity levels. The method binnedHistogram()returns the histogram of the image object ip passed to it as an int array of size B.positive arguments).7The binning method can also be applied,in a similar way,tofloating-point images.3.5Color Image HistogramsWhen referring to histograms of color images,typically what is meant is a histogram of the image intensity(luminance)or of the individual color channels. Both of these variants are supported by practically every image-processing application and are used to objectively appraise the image quality,especially directly after image acquisition.3.5.1Intensity HistogramsThe intensity or luminance histogram h Lum of a color image is nothing more than the histogram of the corresponding grayscale image,so naturally all as-pects of the preceding discussion also apply to this type of histogram.The grayscale image is obtained by computing the luminance of the individual chan-nels of the color image.When computing the luminance,it is not sufficient to simply average the values of each color channel;instead,a weighted sum that 6 x rounds x down to the next whole number(see Appendix A,p.233).7For a more detailed discussion,see the section on integer division in Java in Ap-pendix B(p.237).50 3.Histograms takes into account color perception theory should be computed.This process is explained in detail in Chapter8(p.202).3.5.2Individual Color Channel HistogramsEven though the luminance histogram takes into account all color channels, image errors appearing in single channels can remain undiscovered.For ex-ample,the luminance histogram may appear clean even when one of the color channels is oversaturated.In RGB images,the blue channel contributes only a small amount to the total brightness and so is especially sensitive to this problem.Component histograms supply additional information about the intensity distribution within the individual color channels.When computing component histograms,each color channel is considered a separate intensity image and each histogram is computed independently of the other channels.Figure3.12 shows the luminance histogram h Lum and the three component histograms h R, h G,and h B of a typical RGB color image.Notice that saturation problems in all three channels(red in the upper intensity region,green and blue in the lower regions)are obvious in the component histograms but not in the lumi-nance histogram.In this case it is striking,and not at all atypical,that the three component histograms appear completely different from the correspond-ing luminance histogram h Lum(Fig.3.12(b)).3.5.3Combined Color HistogramsLuminance histograms and component histograms both provide useful informa-tion about the lighting,contrast,dynamic range,and saturation effects relative to the individual color components.It is important to remember that they pro-vide no information about the distribution of the actual colors in the image because they are based on the individual color channels and not the combi-nation of the individual channels that forms the color of an individual pixel. Consider,for example,when h R,the component histogram for the red channel, contains the entryh R(200)=24.Then it is only known that the image has24pixels that have a red intensity value of200.The entry does not tell us anything about the green and blue values of those pixels,which could be any valid value(∗);that is,(r,g,b)=(200,∗,∗).Suppose further that the three component histograms included the following entries:h R(50)=100,h G(50)=100,h B(50)=100.3.5Color Image Histograms 51(a)(b)h Lum(c)R (d)G (e)B(f)h R (g)h G (h)h BFigure 3.12Histograms of an RGB color image:original image (a),luminance histogram h Lum (b),RGB color components as intensity images (c–e),and the associated component histograms h R ,h G ,h B (f–h).The fact that all three color channels have saturation problems is only apparent in the individual component histograms.The spike in the distribution resulting from this is found in the middle of the luminance histogram (b).Could we conclude from this that the image contains 100pixels with the color combination(r,g,b )=(50,50,50)or that this color occurs at all?In general,no,because there is no way of ascertaining from these data if there exists a pixel in the image in which all three components have the value 50.The only thing we could really say is that the color value (50,50,50)can occur at most 100times in this image.So,although conventional (intensity or component)histograms of color im-ages depict important properties,they do not really provide any useful infor-mation about the composition of the actual colors in an image.In fact,a collection of color images can have very similar component histograms and still contain entirely different colors.This leads to the interesting topic of the com-bined histogram,which uses statistical information about the combined color components in an attempt to determine if two images are roughly similar in their color composition.Features computed from this type of histogram often52 3.Histograms form the foundation of color-based image retrieval methods.We will return to this topic in Chapter8,where we will explore color images in greater detail.3.6Cumulative HistogramThe cumulative histogram,which is derived from the ordinary histogram,is useful when performing certain image operations involving histograms;for in-stance,histogram equalization(see Sec.4.5).The cumulative histogram H isdefined asH(i)=ij=0h(j)for0≤i<K.(3.5)A particular value H(i)is thus the sum of all the values h(j),with j≤i,in the original histogram.Alternatively,we can define H recursively(as implemented in Prog.4.2on p.66):H(i)=h(0)for i=0H(i−1)+h(i)for0<i<K.(3.6)The cumulative histogram H(i)is a monotonically increasing function with amaximum valueH(K−1)=K−1j=0h(j)=M·N;(3.7)that is,the total number of pixels in an image of width M and height N.Figure 3.13shows a concrete example of a cumulative histogram.The cumulative histogram is useful not primarily for viewing but as a sim-ple and powerful tool for capturing statistical information from an image.In particular,we will use it in the next chapter to compute the parameters for several common point operations(see Sections4.4–4.6).3.7ExercisesExercise3.1In Prog.3.2,B and K are constants.Consider if there would be an advan-tage to computing the value of B/K outside of the loop,and explain your reasoning.Exercise3.2Develop an ImageJ plugin that computes the cumulative histogram of an 8-bit grayscale image and displays it as a new image,similar to H(i)in Fig.3.13.Hint:Use the ImageProcessor method int[]getHistogram()to retrieve3.7Exercises53iiH(i)Figure3.13The ordinary histogram h(i)and its associated cumulative histogram H(i).the original image’s histogram values and then compute the cumulative histogram“in place”according to Eqn.(3.6).Create a new(blank)image of appropriate size(e.g.,256×150)and draw the scaled histogram data as black vertical bars such that the maximum entry spans the full height of the image.Program3.3shows how this plugin could be set up and how a new image is created and displayed.Exercise3.3Develop a technique for nonlinear binning that uses a table of interval limits a j(Eqn.(3.2)).Exercise3.4Develop an ImageJ plugin that uses the Java methods Math.random()or Random.nextInt(int n)to create an image with random pixel values that are uniformly distributed in the range[0,255].Analyze the image’s his-togram to determine how equally distributed the pixel values truly are. Exercise3.5Develop an ImageJ plugin that creates a random image with a Gaussian (normal)distribution with mean valueμ=128and standard deviation σ=e the standard Java method double Random.nextGaussian() to produce normally-distributed random numbers(withμ=0andσ=1) and scale them appropriately to pixel values.Analyze the resulting image histogram to see if it shows a Gaussian distribution too.54 3.Histograms 1public class Create_New_Image implements PlugInFilter{2String title=null;34public int setup(String arg,ImagePlus im){5title=im.getTitle();6return DOES_8G+NO_CHANGES;7}89public void run(ImageProcessor ip){10int w=256;11int h=100;12int[]hist=ip.getHistogram();1314//create the histogram image:15ImageProcessor histIp=new ByteProcessor(w,h);16histIp.setValue(255);//white=25517histIp.fill();//clear this image1819//draw the histogram values as black bars in ip2here,20//for example,using histIp.putpixel(u,v,0)21//...2223//display the histogram image:24String hTitle="Histogram of"+title;25ImagePlus histIm=new ImagePlus(hTitle,histIp);26histIm.show();27//histIm.updateAndDraw();28}2930}//end of class Create_New_ImageProgram3.3Creating and displaying a new image(ImageJ plugin).First,we create a ByteProcessor object(histIp,line15)that is subsequentlyfilled.At this point,histIp has no screen representation and is thus not visible.Then,an associated ImagePlus object is created(line25)and displayed by applying the show()method(line26).Notice how the title(String)is retrieved from the original image inside the setup()method(line5)and used to compose the new image’s title(lines24and25).If histIp is changed after calling show(),then the method updateAndDraw()could be used to redisplay the associated image again(line27).。
EXPERIMENT 1 Showing and Orthogonal Transform of the Image一.Experimental purpose1.Master the orders of reading/writing and showing.2.Master the methods of transformations between the images of the differenttype.3.Master the methods of the orthogonal transform and the inverse transform.二.Be familiar with the common orders as follows:(skillful mastery)1.The orders of reading/writing and showing:imread read the image fileimfinfo read the related information of the image fileimwrite output the imageImshow show function of the standard imageImage establish and show a image objectImagesc adjust automatically the value field and show theimageColorbar show the color bartheimageMontage spliceImmovie turn the image sequence composed by the index colorimage into the cartoonSubimage show the multi-piece images in a graph windowzoom the image zoomwarp show the image in a curved face by the texturemapping2. The transform orders of image type:Dither image dither, turn the grey scale image into the binaryimage or dither the real color image into the index imageGray2ind turn the grey scale image into the index imageGrayslice turn the grey scale image into the index image by settingthe field valueIm2bw turn the real color, the index color and the grey scale imageinto the binary image by setting the luminance field valueInd2gray turn the index color image into the grey scale imageInd2rgb turn the index color image into the real color imageMat2gray turn the data matrix into the grey scale imageRgb2gray turn the real color image into the grey scale imageRgb2ind turn the real color image into the index color image3. The orders of the orthogonal transform and the inverse transformfft2 two-dimension fft transform ifft2 two-dimension fftinverse transformfftn N-dimensionfft transformifftn N-dimension fft inverse transform fftshift move the center of the spectrum by fft,fft2 and fftn transformsinto the center of the matrix or the vectordct2 two-dimension dct transform idct2 two-dimension dctinverse transform三.Experimental contents:1. read/write and show the image:① Read cameraman.tif file;② Examine the related information of the image and point out the file layout and the type ofthe image;③ Show the image and observe its zoom;④ Show the color bar;⑤ Show the image in imagesc function. Its grey-scale range is 64-128;⑥ Map cameraman.tif into the surface of the cylinder in the warp order;⑦ Load the mri images in the load order and show these images in the montage function,then, turn these image into the cartoon and show the cartoon in the movie function. Attention: the immovie function is applied only to the index image.Cue: load mrimontage (data matrix of the mri, the color map matrix of the mri)mov =immovie (data matrix of the mri, the color map matrix of the mri)colormap (map )movie (mov )2. Transformations between the images of the different type① Turn the RGB image flowers.tif into the grey scale image. Show and compare the twoimages in the same image window;② Turn the index image chess.mat into the grey scale image. Show and compare the twoimages in the same image window;③ Turn the grey scale image cameraman.tif into the binary image (realize individually inthe im2bw and the dither), show and compare the three images in the same image window;④ Turn the grey scale image pout.tif into the index image X (the corresponding colorimages are the gray (128) and gray (16) ). Show and compare the three images in the same image window;3. The orthogonal transform and inverse transform①Calculate two-dimension fast Fourier transform of the saturn2 image and show its spectrum amplitude .Cue: extract the image: load imdemos saturn2②Do the DCT transform to the saturn2 image.③Do two-dimension hadamard transform to the saturn2 image.Cue: firstly: create a two-dimension hadamard orthogonal matrix in the matlab, then,image data multiply the orthogonal matrix.④What are differences of the ①②③ transformations in the energy focus?⑤Remake ①—④ to the autumn.tif image.Cue: need to turn the image into the grey scale image.四.Thought after the class1. Which are the file layouts of image? How do these transformations each other? Which are image types? How do these transformations each other? How do the images of the different type show? Which are the data matrixes of image? How do these transformations each other?2. Which types of image can not be used directly to image processing?EXPERIMENT 2 Image Enhancement 一.Experimental purpose1. Master the fundamental method of the image enhancement and observe the results of theimage enhancement;2. Be familiar with the denoise method of the image processing;3. Be familiar with the transformations of the file layouts and of the color systems;二.Be familiar with the common orders as follows:imadust adjust the contrast by the histogram transformationhisteq histogram equalizationhist show the histogram of the image dataimnoise add the representative noise to the image(gaussian,salt&pepper, speckle)medfilt2 two-dimension median filteringordfilt2 two-dimension sequential statistic filteringwiener2 two-dimension Wiener filtering三.Experimental contents:1.Contrast enhancement① Read the cameraman.tif file;② Show the original image;③ Show the histogram of the image;④ Enhance the contrast of image by the histeq⑤ Show the histogram of the image after the contrast and compare it with the histogram ofthe list ③;⑥ Show the image after the contrast and compare it with the original image.四. Image smoothing① Read the eight,tif file. Show the images added individually by the Gaussiannoise, Salt & pepper noise and multiplicative noise and compare these images.② Three previous images added by the noise make individually two-dimensionmedian filtering, two-dimension sequential statistic filtering and two-dimension Wiener filtering③Compare the original image with the image polluted by the noise and the image after thefilter. Think that which filter is effective to suppress the corresponding noise and the influence of the neighborhood to suppressing noise and image blurring.五. The color of the RGB image flowers.tif becomes more clear and bright.①Read the flower.tif file;②Show the image;③Color space transformation. Turn the RGB color space into the HSV color space(transform function is rgb2hsv )④Enhance saturation component S by the histogram equalization in the HSV color space;⑤Return the HSV color space into the RGB color space;⑥Compare the images transformed previously with the original image and observe whetherthese become more clear and bright.六. Thought after the classWhy the image is dealt with by the Histogram Equalization? Which methods of the image enhancement you can think?EXPERIMENT 3 Boundary Detection and Texture Detection一. Experimental purpose1. Be familiar with the common orders of the boundary detection and boundary detection operator;2. Be familiar with the methods of the boundary detection.二. Be familiar with the common orders as follows:Edgethe boundary detection Sobel Sobel operatorCanny a antinoise and keeping weak boundary operator Robert Robert operatorPrewitt Prewitt operatorLog Log operator(Marr)blkproc block treatingstd22D standard deviation imhist image grey scale statistic三. Experimental contents:1. Boundary detection① Read the rice.tif file;② Show the image;③ Show five images detected individually in the Sober operator, Robert operator, Prewitt operator, Log operator, Canny operator and observe the difference of connectivity in the difference operators. Find the effective method of boundary detection to the rice.tif file. Cue: BW=edge (data matrix of the image, ‘operator’)④ Reduplicate the operation of ①②③ operations to the Saturn.tif image.⑤Help menu->demos->toolboxes->image processing->morphology, analysis and segmentation->egde detection in the matlab. Operate the demo program. Observe the value of the boundary detection by choosing the different images and operators.2. Texture detectionTexture detection can be realized by the method of local grey-scale statistic. The common methods have 2D standard deviation measurement and information entropy measurement. Texture detection is the method of the local detection. So, the texture detection can be realized by the blocking method. Computing formulas of standard deviation and information entropy are()p E is the grey scale mean. k p is the probability of the k grade grey scale.Compute the information entropy of the image by programming function and analyze the texture of the 4×4 block,8×8 block to image in the texture analyse of information entropy.()[]∑∞=−=12k k k p p E x D ∑−=kkk p p E logCue: Refer to the following example during the programming. Attention: firstly, Program information entropy function yourself. (MATLAB supplies 2D standard deviation function in the command line fun=@std2 )Example: texture analyse of the 8×8 sub-block to image in 2D standard deviation measurement.man=imread('cameraman.tif');fun=@std2; % std2 is the 2D standard deviation function.text1=blkproc(man,[8 8],fun);text=imresize(text1,[256 256],'bicubic');subplot(121);imshow(man);title('cameraman');subplot(122);imshow(text,[]); title('8X8 std');EXPERIMENT 4 Image Compression Encoding一. Experimental purpose1. Be familiar with the fundamental of the image compression encoding;2. Be familiar with the fundamental performance of the orthogonal image compression encoding.二.Be familiar with the common orders as follows:dct2 - Compute 2-D discrete cosine transformdctmtx - Compute discrete cosine transform matrix.fft2 - Compute 2-D fast Fourier transform .fftshift - Reverse quadrants of output of FFT.idct2 - Compute 2-D inverse discrete cosine transform.ifft2 - Compute 2-D inverse fast Fourier transform.Hadamard - Hadamard matrix.bestblk - Choose block size for block processing.blkproc - Implement distinct block processing for image.col2im - Rearrange matrix columns into blocks.im2col - Rearrange image blocks into columns.三.Experimental contents:1. Compress the image in the FFT transformation;①Read the rice.tif file;②Normalize the image;③Show the original image;④The image compression ratio is 4:1;⑤Separate the image to the 16×16 sub-image and make the FFT transform;⑥Realign the transform coefficient matrix and Sequence the coefficient matrix;⑦Reserve the higher-order coefficient according to the compression ratio;⑧Realign the coefficient matrix⑨Obtain the recovery images of the sub-images by the FFT inverse transform to sub-images;⑩Show the image compressed and compare it with the original image.2. Compress individually the image in the DCT and HT transforms according to the upper steps. Cue: the orders of the blocking and Hadamard transforms in the Hadamard transform. areT= hadamarda(image blocking size);for example, the image is separated 16×16 blocking, so the blocking size is 16.Hdcoe=blkproc(the image normalized,[16 16]),’P1*x*P2’,T,T)。
Digital Image Processing and Edge DetectionDigital Image ProcessingInterest in digital image processing methods stems from two principal application areas: improvement of pictorial information for human interpretation; and processing of image data for storage, transmission, and representation for autonomous machine perception.An image may be defined as a two-dimensional function, f(x, y), where x and y are spatial (plane) coordinates, and the amplitude of f at any pair of coordinates (x, y) is called the intensity or gray level of the image at that point. When x, y, and the amplitude values of f are all finite, discrete quantities, we call the image a digital image. The field of digital image processing refers to processing digital images by means of a digital computer. Note that a digital image is composed of a finite number of elements, each of which has a particular location and value. These elements are referred to as picture elements, image elements, pixels, and pixels. Pixel is the term most widely used to denote the elements of a digital image.Vision is the most advanced of our senses, so it is not surprising that images play the single most important role in human perception. However, unlike humans, who are limited to the visual band of the electromagnetic (EM) spec- trum, imaging machines cover almost the entire EM spectrum, ranging from gamma to radio waves. They can operate on images generated by sources that humans are not accustomed to associating with images. These include ultra- sound, electron microscopy, and computer-generated images. Thus, digital image processing encompasses a wide and varied field of applications.There is no general agreement among authors regarding where image processing stops and other related areas, such as image analysis and computer vi- sion, start. Sometimes a distinction is made by defining image processing as a discipline in which both the input and output of a process are images. We believe this to be a limiting and somewhat artificial boundary. For example, under this definition, even the trivial task of computing the average intensity of an image (which yields asingle number) would not be considered an image processing operation. On the other hand, there are fields such as computer vision whose ultimate goal is to use computers to emulate human vision, including learning and being able to make inferences and take actions based on visual inputs. This area itself is a branch of artificial intelligence (AI) whose objective is to emulate human intelligence. The field of AI is in its earliest stages of infancy in terms of development, with progress having been much slower than originally anticipated. The area of image analysis (also called image understanding) is in be- tween image processing and computer vision.There are no clearcut boundaries in the continuum from image processing at one end to computer vision at the other. However, one useful paradigm is to consider three types of computerized processes in this continuum: low-, mid-, and high level processes. Low-level processes involve primitive opera- tions such as image preprocessing to reduce noise, contrast enhancement, and image sharpening. A low-level process is characterized by the fact that both its inputs and outputs are images. Mid-level processing on images involves tasks such as segmentation (partitioning an image into regions or objects), description of those objects to reduce them to a form suitable for computer processing, and classification (recognition) of individual objects. A midlevel process is characterized by the fact that its inputs generally are images, but its outputs are attributes extracted from those images (e.g., edges, contours, and the identity of individual objects). Finally, higher level processing involves “making sense” of an ensemble of recognized objects, as in image analysis, and, at the far end of the continuum, performing the cognitive functions normally associated with vision.Based on the preceding comments, we see that a logical place of overlap between image processing and image analysis is the area of recognition of individual regions or objects in an image. Thus, what we call in this book digital image processing encompasses processes whose inputs and outputs are images and, in addition, encompasses processes that extract attributes from images, up to and including the recognition of individual objects. As a simple illustration to clarify these concepts, consider the area of automated analysis of text. The processes of acquiring an image of the area containing the text, preprocessing that image, extracting(segmenting) the individual characters, describing the characters in a form suitable for computer processing, and recognizing those individual characters are in the scope of what we call digital image processing in this book. Making sense of the content of the page may be viewed as being in the domain of image analysis and even computer vision, depending on the level of complexity implied by the statement “making sense.”As will become evident shortly, digital image processing, as we have defined it, is used successfully in a broad range of areas of exceptional social and economic value.The areas of application of digital image processing are so varied that some form of organization is desirable in attempting to capture the breadth of this field. One of the simplest ways to develop a basic understanding of the extent of image processing applications is to categorize images according to their source (e.g., visual, X-ray, and so on). The principal energy source for images in use today is the electromagnetic energy spectrum. Other important sources of energy include acoustic, ultrasonic, and electronic (in the form of electron beams used in electron microscopy). Synthetic images, used for modeling and visualization, are generated by computer. In this section we discuss briefly how images are generated in these various categories and the areas in which they are applied.Images based on radiation from the EM spectrum are the most familiar, especially images in the X-ray and visual bands of the spectrum. Electromagnet- ic waves can be conceptualized as propagating sinusoidal waves of varying wavelengths, or they can be thought of as a stream of massless particles, each traveling in a wavelike pattern and moving at the speed of light. Each massless particle contains a certain amount (or bundle) of energy. Each bundle of energy is called a photon. If spectral bands are grouped according to energy per photon, we obtain the spectrum shown in fig. below, ranging from gamma rays (highest energy) at one end to radio waves (lowest energy) at the other. The bands are shown shaded to convey the fact that bands of the EM spectrum are not distinct but rather transition smoothly from one to theother.Image acquisition is the first process. Note that acquisition could be as simple as being given an image that is already in digital form. Generally, the image acquisition stage involves preprocessing, such as scaling.Image enhancement is among the simplest and most appealing areas of digital image processing. Basically, the idea behind enhancement techniques is to bring out detail that is obscured, or simply to highlight certain features of interest in an image. A familiar example of enhancement is when we increase the contrast of an image because “it looks better.” It is important to keep in mind that enhancement is a very subjective area of image processing. Image restoration is an area that also deals with improving the appearance of an image. However, unlike enhancement, which is subjective, image restoration is objective, in the sense that restoration techniques tend to be based on mathematical or probabilistic models of image degradation. Enhancement, on the other hand, is based on human subjective preferences regarding what constitutes a “good”enhancement result.Color image processing is an area that has been gaining in importance because of the significant increase in the use of digital images over the Internet. It covers a number of fundamental concepts in color models and basic color processing in a digital domain. Color is used also in later chapters as the basis for extracting features of interest in an image.Wavelets are the foundation for representing images in various degrees of resolution. In particular, this material is used in this book for image data compression and for pyramidal representation, in which images are subdivided successively into smaller regions.Compression, as the name implies, deals with techniques for reducing the storage required to save an image, or the bandwidth required to transmit it.Although storage technology has improved significantly over the past decade, the same cannot be said for transmission capacity. This is true particularly in uses of the Internet, which are characterized by significant pictorial content. Image compression is familiar (perhaps inadvertently) to most users of computers in the form of image , such as the jpg used in the JPEG (Joint Photographic Experts Group) image compression standard.Morphological processing deals with tools for extracting image components that are useful in the representation and description of shape. The material in this chapter begins a transition from processes that output images to processes that output image attributes.Segmentation procedures partition an image into its constituent parts or objects. In general, autonomous segmentation is one of the most difficult tasks in digital image processing. A rugged segmentation procedure brings the process a longway toward successful solution of imaging problems that require objects to be identified individually. On the other hand, weak or erratic segmentation algorithms almost always guarantee eventual failure. In general, the more accurate the segmentation, the more likely recognition is to succeed.Representation and description almost always follow the output of a segmentation stage, which usually is raw pixel data, constituting either the boundary of a region (i.e., the set of pixels separating one image region from another) or all the points in the region itself. In either case, converting the data to a form suitable for computer processing is necessary. The first decision that must be made is whether the data should be represented as a boundary or as a complete region. Boundary representation is appropriate when the focus is on external shape characteristics, such as corners and inflections. Regional representation is appropriate when the focus is on internal properties, such as texture or skeletal shape. In some applications, these representations complement each other. Choosing a representation is only part of the solution for trans- forming raw data into a form suitable for subsequent computer processing. A method must also be specified for describing the data so that features of interest are highlighted. Description, also called feature selection, deals with extracting attributes that result in some quantitative information of interest or are basic for differentiating one class of objects from another.Recognition is the process that assigns a label (e.g., “vehicle”) to an object based on its descriptors. As detailed before, we conclude our coverage of digital image processing with the development of methods for recognition of individual objects.So far we have said nothing about the need for prior knowledge or about the interaction between the knowledge base and the processing modules in Fig 2 above. Knowledge about a problem domain is coded into an image processing system in the form of a knowledge database. This knowledge may be as simple as detailing regions of an image where theinformation of interest is known to be located, thus limiting the search that has to be conducted in seeking that information. The knowledge base also can be quite complex, such as an interrelated list of all major possible defects in a materials inspection problem or an image database containing high-resolution satellite images of a region in connection with change-detection applications. In addition to guiding the operation of each processing module, the knowledge base also controls the interaction between modules. This distinction is made in Fig 2 above by the use of double-headed arrows between the processing modules and the knowledge base, as opposed to single-headed arrows linking the processing modules.Edge detectionEdge detection is a terminology in image processing and computer vision, particularly in the areas of feature detection and feature extraction, to refer to algorithms which aim at identifying points in a digital image at which the image brightness changes sharply or more formally has discontinuities.Although point and line detection certainly are important in any discussion on segmentation,edge detection is by far the most common approach for detecting meaningful discounties in gray level.Although certain literature has considered the detection of ideal step edges, the edges obtained from natural images are usually not at all ideal step edges. Instead they are normally affected by one or several of the following effects:1.focal blur caused by a finite depth-of-field and finite point spread function; 2.penumbral blur caused by shadows created by light sources of non-zero radius; 3.shading at a smooth object edge; 4.local specularities or interreflections in the vicinity of object edges.A typical edge might for instance be the border between a block of red color and a block of yellow. In contrast a line (as can be extracted by a ridge detector) can be a small number of pixels of a different color on an otherwise unchanging background. For a line, there maytherefore usually be one edge on each side of the line.To illustrate why edge detection is not a trivial task, let us consider the problem of detecting edges in the following one-dimensional signal. Here, we may intuitively say that there should be an edge between the 4th and 5th pixels.If the intensity difference were smaller between the 4th and the 5th pixels and if the intensity differences between the adjacent neighbouring pixels were higher, it would not be as easy to say that there should be an edge in the corresponding region. Moreover, one could argue that this case is one in which there are several edges.Hence, to firmly state a specific threshold on how large the intensity change between two neighbouring pixels must be for us to say that there should be an edge between these pixels is not always a simple problem. Indeed, this is one of the reasons why edge detection may be a non-trivial problem unless the objects in the scene are particularly simple and the illumination conditions can be well controlled.There are many methods for edge detection, but most of them can be grouped into two categories,search-based and zero-crossing based. The search-based methods detect edges by first computing a measure of edge strength, usually a first-order derivative expression such as the gradient magnitude, and then searching for local directional maxima of the gradient magnitude using a computed estimate of the local orientation of the edge, usually the gradient direction. The zero-crossing based methods search for zero crossings in a second-order derivative expression computed from the image in order to find edges, usually the zero-crossings of the Laplacian of the zero-crossings of a non-linear differential expression, as will be described in the section on differential edge detection following below. As a pre-processing step to edge detection, a smoothing stage, typically Gaussian smoothing, is almost always applied (see also noise reduction).The edge detection methods that have been published mainly differ in the types of smoothing filters that are applied and the way the measures of edge strength are computed. As many edge detection methods rely on the computation of image gradients, they also differ in the types of filters used for computing gradient estimates in the x- and y-directions.Once we have computed a measure of edge strength (typically the gradient magnitude), the next stage is to apply a threshold, to decide whether edges are present or not at an image point. The lower the threshold, the more edges will be detected, and the result will be increasingly susceptible to noise, and also to picking out irrelevant features from the image. Conversely a high threshold may miss subtle edges, or result in fragmented edges.If the edge thresholding is applied to just the gradient magnitude image, the resulting edges will in general be thick and some type of edge thinning post-processing is necessary. For edges detected with non-maximum suppression however, the edge curves are thin by definition and the edge pixels can be linked into edge polygon by an edge linking (edge tracking) procedure. On a discrete grid, the non-maximum suppression stage can be implemented by estimating the gradient direction using first-order derivatives, then rounding off the gradient direction to multiples of 45 degrees, and finally comparing the values of the gradient magnitude in the estimated gradient direction.A commonly used approach to handle the problem of appropriate thresholds for thresholding is by using thresholding with hysteresis. This method uses multiple thresholds to find edges. We begin by using the upper threshold to find the start of an edge. Once we have a start point, we then trace the path of the edge through the image pixel by pixel, marking an edge whenever we are above the lower threshold. We stop marking our edge only when the value falls below our lower threshold. This approach makes the assumption that edges are likely to be in continuous curves, and allows us to follow a faint section of an edge we have previously seen, without meaning that every noisy pixel in the image is marked down as an edge. Still, however, we have the problem of choosing appropriate thresholdingparameters, and suitable thresholding values may vary over the image.Some edge-detection operators are instead based upon second-order derivatives of the intensity. This essentially captures the rate of change in the intensity gradient. Thus, in the ideal continuous case, detection of zero-crossings in the second derivative captures local maxima in the gradient.We can come to a conclusion that,to be classified as a meaningful edge point,the transition in gray level associated with that point has to be significantly stronger than the background at that point.Since we are dealing with local computations,the method of choice to determine whether a value is “significant” or not id to use a threshold.Thus we define a point in an image as being as being an edge point if its two-dimensional first-order derivative is greater than a specified criterion of connectedness is by definition an edge.The term edge segment generally is used if the edge is short in relation to the dimensions of the image.A key problem in segmentation is to assemble edge segments into longer edges.An alternate definition if we elect to use the second-derivative is simply to define the edge ponits in an image as the zero crossings of its second derivative.The definition of an edge in this case is the same as above.It is important to note that these definitions do not guarantee success in finding edge in an image.They simply give us a formalism to look for them.First-order derivatives in an image are computed using the gradient.Second-order derivatives are obtained using the Laplacian.数字图像处理和边缘检测数字图像处理在数字图象处理方法的兴趣从两个主要应用领域的茎:改善人类解释图像信息;和用于存储,传输,和表示用于自主机器感知图像数据的处理。
数字图象处理英文原版及翻译Digital Image Processing: English Original Version and TranslationIntroduction:Digital Image Processing is a field of study that focuses on the analysis and manipulation of digital images using computer algorithms. It involves various techniques and methods to enhance, modify, and extract information from images. In this document, we will provide an overview of the English original version and translation of digital image processing materials.English Original Version:The English original version of digital image processing is a comprehensive textbook written by Richard E. Woods and Rafael C. Gonzalez. It covers the fundamental concepts and principles of image processing, including image formation, image enhancement, image restoration, image segmentation, and image compression. The book also explores advanced topics such as image recognition, image understanding, and computer vision.The English original version consists of 14 chapters, each focusing on different aspects of digital image processing. It starts with an introduction to the field, explaining the basic concepts and terminology. The subsequent chapters delve into topics such as image transforms, image enhancement in the spatial domain, image enhancement in the frequency domain, image restoration, color image processing, and image compression.The book provides a theoretical foundation for digital image processing and is accompanied by numerous examples and illustrations to aid understanding. It also includes MATLAB codes and exercises to reinforce the concepts discussed in each chapter. The English original version is widely regarded as a comprehensive and authoritative reference in the field of digital image processing.Translation:The translation of the digital image processing textbook into another language is an essential task to make the knowledge and concepts accessible to a wider audience. The translation process involves converting the English original version into the target language while maintaining the accuracy and clarity of the content.To ensure a high-quality translation, it is crucial to select a professional translator with expertise in both the source language (English) and the target language. The translator should have a solid understanding of the subject matter and possess excellent language skills to convey the concepts accurately.During the translation process, the translator carefully reads and comprehends the English original version. They then analyze the text and identify any cultural or linguistic nuances that need to be considered while translating. The translator may consult subject matter experts or reference materials to ensure the accuracy of technical terms and concepts.The translation process involves several stages, including translation, editing, and proofreading. After the initial translation, the editor reviews the translated text to ensure its coherence, accuracy, and adherence to the target language's grammar and style. The proofreader then performs a final check to eliminate any errors or inconsistencies.It is important to note that the translation may require adapting certain examples, illustrations, or exercises to suit the target language and culture. This adaptation ensures that the translated version resonates with the local audience and facilitates better understanding of the concepts.Conclusion:Digital Image Processing: English Original Version and Translation provides a comprehensive overview of the field of digital image processing. The English original version, authored by Richard E. Woods and Rafael C. Gonzalez, serves as a valuable reference for understanding the fundamental concepts and techniques in image processing.The translation process plays a crucial role in making this knowledge accessible to non-English speakers. It involves careful selection of a professional translator, thoroughunderstanding of the subject matter, and meticulous translation, editing, and proofreading stages. The translated version aims to accurately convey the concepts while adapting to the target language and culture.By providing both the English original version and its translation, individuals from different linguistic backgrounds can benefit from the knowledge and advancements in digital image processing, fostering international collaboration and innovation in this field.。
数字图像处理外文翻译外文文献英文文献数字图像处理Digital Image Processing1 IntroductionMany operators have been proposed for presenting a connected component n a digital image by a reduced amount of data or simplied shape. In general we have to state that the development, choice and modi_cation of such algorithms in practical applications are domain and task dependent, and there is no \best method". However, it isinteresting to note that there are several equivalences between published methods and notions, and characterizing such equivalences or di_erences should be useful to categorize the broad diversity of published methods for skeletonization. Discussing equivalences is a main intention of this report.1.1 Categories of MethodsOne class of shape reduction operators is based on distance transforms. A distance skeleton is a subset of points of a given component such that every point of this subset represents the center of a maximal disc (labeled with the radius of this disc) contained in the given component. As an example in this _rst class of operators, this report discusses one method for calculating a distance skeleton using the d4 distance function which is appropriate to digitized pictures. A second class of operators produces median or center lines of the digitalobject in a non-iterative way. Normally such operators locate critical points _rst, and calculate a speci_ed path through the object by connecting these points.The third class of operators is characterized by iterative thinning. Historically, Listing [10] used already in 1862 the term linear skeleton for the result of a continuous deformation of the frontier of a connected subset of a Euclidean space without changing the connectivity of the original set, until only a set of lines and points remains. Many algorithms in image analysis are based on this general concept of thinning. The goal is a calculation of characteristic properties of digital objects which are not related to size or quantity. Methods should be independent from the position of a set in the plane or space, grid resolution (for digitizing this set) or the shape complexity of the given set. In the literature the term \thinning" is not used - 1 -in a unique interpretation besides that it always denotes a connectivity preserving reduction operation applied to digital images, involving iterations of transformations of speci_ed contour points into background points. A subset Q _ I of object points is reduced by ade_ned set D in one iteration, and the result Q0 = Q n D becomes Q for the next iteration. Topology-preserving skeletonization is a special case of thinning resulting in a connected set of digital arcs or curves.A digital curve is a path p =p0; p1; p2; :::; pn = q such that pi is a neighbor of pi?1, 1 _ i _ n, and p = q. A digital curve is called simpleif each point pi has exactly two neighbors in this curve. A digital arc is a subset of a digital curve such that p 6= q. A point of a digital arc which has exactly one neighbor is called an end point of this arc. Within this third class of operators (thinning algorithms) we may classify with respect to algorithmic strategies: individual pixels are either removed in a sequential order or in parallel. For example, the often cited algorithm by Hilditch [5] is an iterative process of testing and deleting contour pixels sequentially in standard raster scan order. Another sequential algorithm by Pavlidis [12] uses the de_nition of multiple points and proceeds by contour following. Examples of parallel algorithms in this third class are reduction operators which transform contour points into background points. Di_erences between these parallel algorithms are typically de_ned by tests implemented to ensure connectedness in a local neighborhood. The notion of a simple point is of basic importance for thinning and it will be shown in this reportthat di_erent de_nitions of simple points are actually equivalent. Several publications characterize properties of a set D of points (to be turned from object points to background points) to ensure that connectivity of object and background remain unchanged. The report discusses some of these properties in order to justify parallel thinning algorithms.1.2 BasicsThe used notation follows [17]. A digital image I is a functionde_ned on a discrete set C , which is called the carrier of the image.The elements of C are grid points or grid cells, and the elements (p;I(p)) of an image are pixels (2D case) or voxels (3D case). The range of a (scalar) image is f0; :::Gmaxg with Gmax _ 1. The range of a binary image is f0; 1g. We only use binary images I in this report. Let hIi be the set of all pixel locations with value 1, i.e. hIi = I?1(1). The image carrier is de_ned on an orthogonal grid in 2D or 3D - 2 -space. There are two options: using the grid cell model a 2D pixel location p is a closed square (2-cell) in the Euclidean plane and a 3D pixel location is a closed cube (3-cell) in the Euclidean space, where edges are of length 1 and parallel to the coordinate axes, and centers have integer coordinates. As a second option, using the grid point model a 2D or 3D pixel location is a grid point.Two pixel locations p and q in the grid cell model are called 0-adjacent i_ p 6= q and they share at least one vertex (which is a 0-cell). Note that this speci_es 8-adjacency in 2D or 26-adjacency in 3D if the grid point model is used. Two pixel locations p and q in the grid cell model are called 1- adjacent i_ p 6= q and they share at least one edge (which is a 1-cell). Note that this speci_es 4-adjacency in 2D or 18-adjacency in 3D if the grid point model is used. Finally, two 3Dpixel locations p and q in the grid cell model are called 2-adjacent i_ p 6= q and they share at least one face (which is a 2-cell). Note that this speci_es 6-adjacency if the grid point model is used. Any of these adjacency relations A_, _ 2 f0; 1; 2; 4; 6; 18; 26g, is irreexive andsymmetric on an image carrier C. The _-neighborhood N_(p) of a pixel location p includes p and its _-adjacent pixel locations. Coordinates of 2D grid points are denoted by (i; j), with 1 _ i _ n and 1 _ j _ m; i; j are integers and n;m are the numbers of rows and columns of C. In 3Dwe use integer coordinates (i; j; k). Based on neighborhood relations wede_ne connectedness as usual: two points p; q 2 C are _-connected with respect to M _ C and neighborhood relation N_ i_ there is a sequence of points p = p0; p1; p2; :::; pn = q such that pi is an _-neighbor of pi?1, for 1 _ i _ n, and all points on this sequence are either in M or all in the complement of M. A subset M _ C of an image carrier is called _-connected i_ M is not empty and all points in M are pairwise _-connected with respect to set M. An _-component of a subset S of C is a maximal _-connected subset of S. The study of connectivity in digital images has been introduced in [15]. It follows that any set hIi consists of a number of _-components. In case of the grid cell model, a component is the union of closed squares (2D case) or closed cubes (3D case). The boundary of a 2-cell is the union of its four edges and the boundary of a 3-cell is the union of its six faces. For practical purposes it iseasy to use neighborhood operations (called local operations) on adigital image I which de_ne a value at p 2 C in the transformed image based on pixel- 3 -values in I at p 2 C and its immediate neighbors in N_(p).2 Non-iterative AlgorithmsNon-iterative algorithms deliver subsets of components in specied scan orders without testing connectivity preservation in a number of iterations. In this section we only use the grid point model.2.1 \Distance Skeleton" AlgorithmsBlum [3] suggested a skeleton representation by a set of symmetric points.In a closed subset of the Euclidean plane a point p is called symmetric i_ at least 2 points exist on the boundary with equal distances to p. For every symmetric point, the associated maximal discis the largest disc in this set. The set of symmetric points, each labeled with the radius of the associated maximal disc, constitutes the skeleton of the set. This idea of presenting a component of a digital image as a \distance skeleton" is based on the calculation of a speci_ed distance from each point in a connected subset M _ C to the complement of the subset. The local maxima of the subset represent a \distance skeleton". In [15] the d4-distance is specied as follows. De_nition 1 The distance d4(p; q) from point p to point q, p 6= q, is the smallest positive integer n such that there exists a sequence of distinct grid points p = p0,p1; p2; :::; pn = q with pi is a 4-neighbor of pi?1, 1 _ i _ n.If p = q the distance between them is de_ned to be zero. Thedistance d4(p; q) has all properties of a metric. Given a binary digital image. We transform this image into a new one which represents at each point p 2 hIi the d4-distance to pixels having value zero. The transformation includes two steps. We apply functions f1 to the image Iin standard scan order, producing I_(i; j) = f1(i; j; I(i; j)), and f2in reverse standard scan order, producing T(i; j) = f2(i; j; I_(i; j)), as follows:f1(i; j; I(i; j)) =8><>>:0 if I(i; j) = 0minfI_(i ? 1; j)+ 1; I_(i; j ? 1) + 1gif I(i; j) = 1 and i 6= 1 or j 6= 1- 4 -m+ n otherwisef2(i; j; I_(i; j)) = minfI_(i; j); T(i+ 1; j)+ 1; T(i; j + 1) + 1g The resulting image T is the distance transform image of I. Notethat T is a set f[(i; j); T(i; j)] : 1 _ i _ n ^ 1 _ j _ mg, and let T_ _ T such that [(i; j); T(i; j)] 2 T_ i_ none of the four points in A4((i; j)) has a value in T equal to T(i; j)+1. For all remaining points (i; j) let T_(i; j) = 0. This image T_ is called distance skeleton. Now weapply functions g1 to the distance skeleton T_ in standard scan order, producing T__(i; j) = g1(i; j; T_(i; j)), and g2 to the result of g1 in reverse standard scan order, producing T___(i; j) = g2(i; j; T__(i; j)), as follows:g1(i; j; T_(i; j)) = maxfT_(i; j); T__(i ? 1; j)? 1; T__(i; j ? 1) ? 1gg2(i; j; T__(i; j)) = maxfT__(i; j); T___(i + 1; j)? 1; T___(i; j + 1) ? 1gThe result T___ is equal to the distance transform image T. Both functions g1 and g2 de_ne an operator G, with G(T_) = g2(g1(T_)) = T___, and we have [15]: Theorem 1 G(T_) = T, and if T0 is any subset of image T (extended to an image by having value 0 in all remaining positions) such that G(T0) = T, then T0(i; j) = T_(i; j) at all positions of T_with non-zero values. Informally, the theorem says that the distance transform image is reconstructible from the distance skeleton, and it is the smallest data set needed for such a reconstruction. The useddistance d4 di_ers from the Euclidean metric. For instance, this d4-distance skeleton is not invariant under rotation. For an approximation of the Euclidean distance, some authors suggested the use of di_erent weights for grid point neighborhoods [4]. Montanari [11] introduced a quasi-Euclidean distance. In general, the d4-distance skeleton is a subset of pixels (p; T(p)) of the transformed image, and it is not necessarily connected.2.2 \Critical Points" AlgorithmsThe simplest category of these algorithms determines the midpointsof subsets of connected components in standard scan order for each row. Let l be an index for the number of connected components in one row of the original image. We de_ne the following functions for 1 _ i _ n: ei(l) = _ j if this is the lth case I(i; j) = 1 ^ I(i; j ? 1) = 0 in row i, counting from the left, with I(i;?1) = 0 ,oi(l) = _ j if this is the lth case I(i; j) = 1- 5 -^ I(i; j+ 1) = 0 ,in row i, counting from the left, with I(i;m+ 1)= 0 ,mi(l) = int((oi(l) ?ei(l)=2)+ oi(l) ,The result of scanning row i is a set ofcoordinates (i;mi(l)) ofof the connected components in row i. The set of midpoints of all rows midpoints ,constitutes a critical point skeleton of an image I. This method is computationally eÆcient.The results are subsets of pixels of the original objects, and these subsets are not necessarily connected. They can form \noisy branches" when object components are nearly parallel to image rows. They may be useful for special applications where the scanning direction is approximately perpendicular to main orientations of object components.References[1] C. Arcelli, L. Cordella, S. Levialdi: Parallel thinning ofbinary pictures. Electron. Lett. 11:148{149, 1975}.[2] C. Arcelli, G. Sanniti di Baja: Skeletons of planar patterns. in: Topolog- ical Algorithms for Digital Image Processing (T. Y. Kong, A. Rosenfeld, eds.), North-Holland, 99{143, 1996.}[3] H. Blum: A transformation for extracting new descriptors of shape. in: Models for the Perception of Speech and Visual Form (W. Wathen- Dunn, ed.), MIT Press, Cambridge, Mass., 362{380, 1967.19} - 6 -数字图像处理1引言许多研究者已提议提出了在数字图像里的连接组件是由一个减少的数据量或简化的形状。