1、 Digital Image ProcessingTianjin University of Technology and EducationSchool of Electronic Engineering2017SynopsisThe contents of the eight weeks are as follows:l The first、second chapter is the introduction and the basic concept of image processing.l The third,fourth chapter is space domain and fr
2、equency domain transforml The fifth,eighth chapter is image enhancement and image restoration.l The sixth chapter is image codingl The seventh,ninth chapter is image segmentation and morphologyl The tenth chapter,otherThe first chapter is introduction1.1 From image to image engineering Image and dig
3、ital image Image technology and image engineering Related disciplines and fields.1.2 Image processing and analysis Image processing and analysis system Image acquisition,display,storage,communication,processing and analysis moduleimage processingimage analysisImage understandingAbstract degreeData q
4、uantityImage foundation1.1.1 Image and digital image1.1.1 Image and digital image What is an image?An image is a visual representation of pictures,animations,etc.The difference between graphics and computer graphics is that computer graphics are from building mathematical models to generating graphi
5、cs,and images usually refer to graphs generated from outside.The objective world is a three-dimensional space,but the general image is two-dimensional.Two dimensional images inevitably lose part of the information in the process of reflecting the three-dimensional world.Even recorded information can
6、 be distorted and even difficult to recognize objects.Therefore,it is necessary to recover and reconstruct information from images,and to analyze and extract mathematical models of images so that people can have a correct and profound understanding of what is recorded in the image.This process becom
7、es the process of image processing.1.1 From image to image engineering Why do you need digital images?Ordinary images contain enormous amounts of information and require the use of computers to process images.Therefore,it is necessary to transform ordinary images into digital images that the compute
8、r can process.Todays digital cameras can directly convert visual images into digital images.A digital image,similar to raster graphics,consisting of finite rows and finite columns.Each basic unit is called a pixel.The voxel of a three-dimensional image is also called voxel.The two-dimensional digita
9、l image usually is a rectangle,you can use a two-dimensional array of I(x,y)to said,where x,y coordinates in a two-dimensional space is a coordinate system,I(x,y)said in the image gray value at the point and other properties.Color can be prepared three RGB monochromatic gray value.Generally speaking
10、,these coordinates and gray values are real numbers,not only depend on the selection of coordinate system,but also depend on the measurement unit of gray value.However,a digital computer can only represent finite numbers of finite word lengths.Therefore,the gray value must be discretized.Simply put,
11、a digital image is equivalent to a finite matrix of integer values.Digital image is the object of digital image processing and analysis.The image on the left is the image processing technique.Used to test computer algorithms A standard image of actual effects.The name of this image is lenna.It is ma
12、de up of a set of numbers.Original image The width and height are 256 pixels each.There are eight bits in pixels.It is in BMP form at About 66K bytes in size.A brief history of digital image processing The generation of digital pictures is far ahead of the computer.The first digital image transmitte
13、d by telegraph.In six and 70s,with the development of computer hardware and the discovery of fast Fu Liye transform algorithm,it was possible to use computer to process images.Since 80s,three dimensional images have been processed.Since 90s,with the improvement of computer performance and extensive
14、use,image processing technology has been involved in every corner of society.The image has gradually dominated the media and produced many new industries and new opportunities.The future development of the image processing is limitless.Digital image processing belongs to computer science,but 90%of i
15、t relies on mathematics.From this point of view,the digital image processing technology is a very ideal direction for the students of this specialty.1.1.2 Image technology and image engineering1.1.2 Image technology and image engineering Which belongs to image technology?Image technology is a genera
16、l term for the technology concerned with images.It is a kind of comprehensive technical engineering.It includes image acquisition,acquisition,encoding,storage and transmission,image generation,display and output,image transformation,enhancement,restoration and reconstruction,image segmentation,targe
17、t detection,expression and description,feature extraction,image classification,image recognition,modeling and matching,image and scene understanding.Narrow sense digital image processing refers to the enhancement,restoration and reconstruction of an image.The object of operation is the pixel of an i
18、mage,and the output is an image.What is image engineering?(generalized digital image processing)It is composed of three systems:image processing,image analysis and image understanding.Image processing includes image acquisition and transformation from image to image,so as to improve the subjective v
19、isual effect and to do preliminary processing for image analysis and image understanding.Image analysis is to extract the data of interest from the image to describe the characteristics of the target in the image.Image understanding is based on image analysis to study the nature and relationship of
20、each object,in order to get the understanding of the content of the image and explain the original scene.Image processing,image analysis and image understanding are three different abstract processes from low to high.This course focuses on image processing and analysis systems.image processingimage
21、understandingimage analysisAbstract degreeData quantityImageDataSymbol1.1.3 Related disciplines and fields Image engineering is a systematic study of various image theories,techniques and applications.From the research method,and mathematics,physics,psychology,biology,electronics,computer science ca
22、n learn from each other,from the scope of it,and pattern recognition,computer vision,computer graphics and other disciplines.1.2 Image processing and analysis1.2.1 Image processing and analysis system The image processing and analysis system includes the following modules:image acquisition module,im
23、age display module,image storage module,image communication module and image processing and analysis module.1.2.2 Modular Image acquisition module Image display module Image storage module Image communication module Image processing and analysis module1.2.1 The data structure of an image file The ba
24、sic functions of a complete image processing program are:open image files,display images,image files for the specified processing,storage of image files.Since image files are large,they usually need to be compressed before storage.So opening and storing image files involves the format of the file.Fo
25、rmat of image file The image file refers to the file containing the image data.In addition to the image data itself,the document generally has the image description information for the image to read and display.Represents a vector or raster form of an image.In vector form,the image is represented by
26、 a series of line segments or line segments,and the gray levels of the segments can be different.Each part of the composite body can be filled with different gray levels.A vector form file has a series of commands and data,and the result is an image.Image data file is mainly raster form,that is,the
27、image is a collection of image points,more suitable for complex images change.Its main drawback is the lack of links between objects and pixels,and changes in the image during the expansion of the image.For example,common image file types are BMP,JPG,and so on.The image processing program must consi
28、der the format of the image file,otherwise it is not possible to open and save the image file properly.Pgm format Many universities in the United States use pgm format to avoid using compressed file formats,which is very convenient for beginners.Here is an image of this format.This is a color pictur
29、e in pgm formatThis is the pgm format,color photos,16 part system code.The original code is not a string of branches.Its written in the form of a branch(attention:LF=SP=newline;space;#=comment line):0 x50 0 x35 0 x0A expressP5(LF);0 x23 0 x20 0 x20 0 x49 0 x0A expess#(SP)(SP)I(LF);0 x36 0 x34 0 x30
30、0 x20 0 x34 0 x38 0 x30 0 x0A express 640(SP)480(LF);0 x32 0 x35 0 x35 0 x0A expess 255(LF)0 x27 0 x27 express 23,23,(Pixel gray value)The decoding of this image file:P5#Imported from SUN image:LEGGO_HOUSE_1.0.intensity640 4802550 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27
31、 0 x27 0 x26 0 x27 0 x27 0 x27 0 x28 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x26 0 x27 0 x26 0 x27 0 x28 0 x27 0 x27 0 x26 0 x27 0 x27 0 x27 0 x28 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x28 0 x28 0 x27 0 x28 0 x29 0 x28 0 x27 0 x28 0 x28
32、 0 x28 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x27 0 x28 0 x27 0 x28 0 x28 0 x28 0 x28 0 x28 0 x28 0 x28 0 x28 0 x28 0 x29 0 x29 0 x29 0 x28 0 x28 0 x28 0 x28.PGM format digital image file is a common form of image processing,teaching and research in American computer science.Although the volume of fi
33、les is relatively large,the pixel is directly related to the number,so it is easy to check and modify.It consists of two parts:1、the first part is the file head,which consists of several rows:The first line illustrates the type of file,for example,P2(for black and white images)or P5(for color images
34、);Then is to#at the beginning of the annotation,the comment line does not perform in the software when the image is opened,can not comment,or how to#at the beginning of the comment line;The first line after the comment line specifies the size of the digital image,for example,640480(640 pixels wide,4
35、80 pixels high,with a space in the middle);The next line specifies the gray scale of the image,for example,255.There are no punctuation marks at the end of each line.2、The 2 and second parts are bitmap arrays that are no longer segmented.For example,in the 256 gray scale,the P2 type is one pixel,one
36、 byte(8 bits),and the P5 type is one pixel,three bytes(R,G,B,8 bits each).The second chapter is about image and vision2.1 Introduction and reviewThe foundation includes three parts:vision base,imaging base and image foundation:l Visual basis(human eyes and brightness,vision,color,vision)l Imaging Fu
37、ndamentals(model,geometry,and sampling quantization)l Image basis(inter pixel relation,image operation and image coordinate transformation)Be careful:Visual:refers to the stimulation of light to the senses and the sense of the visual system.Visual perception:how to form an image of the external worl
38、d through vision.2.2 Human eye and brightness vision2.2.1 Human eye image The human eye is a complex visual organ.The front of the eye has a lens,the lens of a camera.The posterior part of the eyeball has the retina.There are two photoreceptors on the surface of the retina:cones and column cells.The
39、re are six and seven million cone cells in the eye,which are sensitive to bright light and color.The eye divides the details with the aid of cones,because each cone is connected to the nerve ending.The vision of cones is called light vision.There are 750 thousand to 1 million 500 thousand column cel
40、ls in the eye.They are large,and several column cells are attached to one nerve end.Low resolution,mainly providing overall visual impression.Although they are not sensitive to color,they are sensitive to weak light.The vision of cylindrical cells is called dark vision.The center of the retina is th
41、e fovea,an area of about 1.5 1.5mm2 long,the cone cell density reached 150000/mm2,is the most sensitive eye area.Human eye structure人眼成像Density and distribution of cones and column cells2.2.2 Brightness adaptation and differentiationSubjective brightness and subjective adaptability,because the digit
42、al image displays the image with objective brightness,the human eye gets the vision with subjective brightness,so the brightness adaptability of human eye affects the result of image processing.The visual system of the human eye can adapt to the brightness level of the light,from visible darkness to
43、 glare,the difference can reach 1010 levels.But the human eye does not see objects in such a large range at the same time,and can only adapt to a small range of brightness changes at the same time(level 106).lUnder certain conditions,the current sensitivity of a visual system is called the brightnes
44、s adaptation level.The sensitivity is verified by experiments.In the experiment,gradually increase the light intensity of I,change a lot for I,to achieve a number of observers can perceive,when people perceived half of the increase in the I/I Weber ratio has become a lot,as the sensitivity of the cu
45、rrent visual system.In very strong light,it is necessary to change the intensity of the light to allow multiple observers to perceive;on the contrary,in a certain intensity of light,the slight changes in light intensity will make people perceive.The subjective brightness of the human eye is nonlinea
46、r,for example,the Mach bandOptical illusions of human eyes2.3 color visionAccording to the structure of the human eye,all colors are different combinations of three basic colors All colors can be regarded as the superposition of three basic colors,can be seen as the three color(a color removal from
47、white)superpositionThree basic features of color:gray,hue and saturation,and the latter are called chromaticity.The gray scale is proportional to the reflectivity of the object;the hue is related to the main spectrum in the light;the saturation is related to the purity of the hue.The three stimuli t
48、hat make up the color C are X,Y,Z,and the percentages are x,y,ZX=X/(X+Y+Z),y=Y/(X+Y+Z),z=1-X-Y.2.5 imaging transformationLet W(X,Y,Z)be the coordinates of any point in the 3D space,Z=According to the properties of similar triangles,x/=X/(-Z),y/=Y/(-Z),x=X/(-Z),y=Y/(-Z)Make use of point wh homogeneou
49、s coordinates(kX,kY,kZ,K)1 0 0 0P=0 1 0 00 0 1 00 0 -1/1ch=Pwh=P(kX,kY,kZ,k)=(kX,kY,kZ,-(k/)Z+k)=(x,y,z,1)x=kX/(-k/Z+k)=X/(-Z),the same way to get y and ZxZ(X,Y,Z)0wh=P-1ch 1 0 0 0P-1=0 1 0 0 0 0 1 0 0 0 1/1wh=P-1(x,y,0,1)=(x,y,0,1).There is no coordinate component Z,so the point of 3D cannot be rep
50、resentedIf additional depth information Z is known,then the point of 3D can be represented,(X,Y,Z,1)=wh=P-1(x,y,z,1)=(x,y,z,z/+1).其中,X=x/(+z),Y=y/(+z),Z=z/(+z)2.6 sampling and quantification An image needs to be discretized to become a digital image before it can be processed by a computer.The discr