北邮国院视频图像处理.docx

上传人:牧羊曲112 文档编号:2762929 上传时间:2023-02-24 格式:DOCX 页数:29 大小:18.44MB
返回 下载 相关 举报
北邮国院视频图像处理.docx_第1页
第1页 / 共29页
北邮国院视频图像处理.docx_第2页
第2页 / 共29页
北邮国院视频图像处理.docx_第3页
第3页 / 共29页
北邮国院视频图像处理.docx_第4页
第4页 / 共29页
北邮国院视频图像处理.docx_第5页
第5页 / 共29页
点击查看更多>>
资源描述

《北邮国院视频图像处理.docx》由会员分享,可在线阅读,更多相关《北邮国院视频图像处理.docx(29页珍藏版)》请在三一办公上搜索。

1、精选优质文档-倾情为你奉上EBU723U Image and Video Processing 2014/15Coursework report and exercisesName:_Yu Ma_Username:_jp10212769_Exercise 1 (a)Reading/writing PGM/PPM images: The first step towards image and video processing is reading images from file and write them to file. There exist different standards t

2、hat store the information in different formats; before opening an image, knowledge of the standard is necessary. Two widely used image formats are PPM and PGM. The PGM format is a greyscale file format designed to be easy to manipulate. A PGM image represents a greyscale graphic image. For most purp

3、oses, a PGM image can just be thought of an array of integers. The name PGM is the acronym of Portable Grey Map. The name PPM is the acronym for Portable Pixel Map. Images in this format (or a precursor of it) were once also called portable pixmaps. It is a highly redundant format, and contains a lo

4、t of information that the Human Visual System (HVS) cannot even discern. However, as PGM, PPM is very easy to write and analyze. The goal of the first part of todays lab is to let students become comfortable with these two formats. You will implement functions to read and to write PPM and PGM images

5、. The final demonstration of the implemented software will be done using well-known test images: LENA, BABOON, PEPPERS, etc. You can find PPM and PGM versions of these images in the EBU723U intranet pages. The writing function must add as comment in the header: “image created by your_name your_surna

6、me”. Include in your submission the file resulting from reading the images provided and writing them back in their original format.Summarize in 5 points the operations necessary to read a PGM/PPM image:1. Open the image in read mode.2. Ignore comments in the file3. Distinguish the image is a PGM or

7、PPM.4. Read information of the image.5. Read matrix.Summarize in 5 points the operations necessary to write a PGM/PPM image:1. Open the image in write mode.2. Write comments in the file.3. Decide writting a PGM or PPM image.4. Write information of the image.5. Write matrix.What is the difference bet

8、ween the identifier P3 and P6?For identifier P3,the image is stored as ASCII and each line is less than 70 characters.For identifier P6,the image is stored as binary.P6 format is smaller than P3 format and read P6 format file is faster than P3 format file.Exercise 1 (b)Format conversions: in this pa

9、rt of the lab, the images will be converted from colour to grey scale; in other words a PPM image will be converted to the PGM format. You will implement a function called “BUPT_format_converter” which transforms images from color to grey-scale using the following YUV conversion:Y = 0.257R + 0.504G

10、+ 0.098B + 16U = 0.439R + 0.368G 0.071B + 128V = -0.148R 0.291G + 0.439B + 128What component represents the luminance, i.e. the grey-levels, of an image? Y represents the luminance.Use thee boxes to display the results for the colour to grey-scale conversion. Lena colour (RGB)Lena greyBaboon greyBab

11、oon colour (RGB)Is the transformation between the two colour-spaces linear? Motivate your answerThe transformation between the two colour-spaces is linear.Transform each layer,then combine each outcome.Or Transform layers together.These two outcomes are same.f(ax+by) = af(x)+bf(y)Display in the box

12、the Lena image converted to YUV 3 channels format. Are the colors of the previous picture distorted? If yes why?They are different.Because RGB used for PC and YUV used for TV.If we show YUV image on PC,it will be distorted.Based on the formula for the RGB to YUV conversion, derive the formula for th

13、e YUV to RGB conversion?R=1.164*(Y-16)+1.596*(V-128)G=1.164*(Y-16)-0.813*(V-128)-0.391*(U-128)B=1.164*(Y-16)+2.018*(U-128)Use the formula you derived at the previous step to convert the YUV image back to the original RGB format. Display the result in the box.Exercise 1 (c)Sub-sampling: The HVS is in

14、capable of perceiving certain details in an image. Therefore high compression ratios can be achieved by exploiting the characteristics of the HVS, thus discarding what has a low visual relevance. However, this process can introduce distortions in the compressed data. A simple way to exploit the char

15、acteristics of the HVS compression purposes is to sub-sample an image. A drawback of this approach is that it is possible to incur in well-know problems of a discrete representation, such as aliasing. This part of the lab covers some simple sub-sampling operations.Implement a function that sub-sampl

16、es grey level images by a factor n, with n a multiple of 2. The function should be able to sub-sample independently in the horizontal and in the vertical direction or in both directions at the same time. Display the results of sub-sampling the image Lena using the following factors: 2 horizontal, 2

17、vertical, 2 vertical and 8 horizontal, 4 vertical and 4 horizontal. Include the files of the results in the submission. Box for the 4 images2 horizontal2vertical2 vertical and 8 horizontal4 vertical and 4 horizontalDescribe using your own words the aliasing problem and how to avoid it, as applied to

18、 signal processingAliasing occurs when the sample frequency is not high enough so that a the sampled signal cannot represent a the original a signals, like the blur of image edges and a pitch changes a of music.To avoid it, we should choose a the sample frequency more than twice of highest frequency

19、 of signal according to Nyquist sample a theory. For practical a solutions, we always increase sample frequency or decrease highest signal frequency.Given a scene sampled by a ccd with minimum horizontal sampling frequency 10cm-1, what is the maximum horizontal frequency in the image that can be cor

20、rectly represented?Fs=10cm-1 Fs=2*FmaxSo Fmax=5cm-1If you sub-sample an image, why do you have more problems related to aliasing?When we a do this, the pixels a are a reduced. As a result, the resolution a are decresed.Paste below a clear example of artifacts generated by aliasing. For this task you

21、 can use your own choice of image. Use the box below for the image and comments.4 vertical and 2 horizontalExercise 2 (a)Quantize: Quantization is the process of approximating the continuous values in the image data with a finite set of discrete values. The input of a quantizer is the original data

22、and the output is one among the finite number of levels. This process is an approximation, and a good quantizer is one which represents the original signal with minimum loss (quantization error). In this lab, you will work with a scalar uniform quantizer applied to grey-scale images.Lena, quantizati

23、on factor 2Baboon, quantization factor 8Implement a function that uniformly quantizes grey level images. The function will allow the reduction of the number of grey level values by a given factor n (a power of 2). Note. To visualize the image, you need to re-map it in the 8-bit-per-pixel representat

24、ion. Show the results in the boxes below.Peppers, quantization factor 128Peppers, quantization factor 32专心-专注-专业Is quantization a reversible process? Can you recover what you discarded? Briefly explain.No, for the quantization process, some colour level are reduced and we cannot a get them back beca

25、use we a do not know which a pixel do we a change into near colour.Write the results back to PGM/PPM files using the function you created. Make sure that your writing function allocates a correct number of bits per pixel. What is the size of the files compared with the original? Given the results, w

26、hat is a typical application field for quantization? Include in your submission the output files and comment on the results.The size of files becomes smaller. Because we reduce some colour level, the bits that are used for represent a colour are becomes less. The file a are compressed. If a we ues f

27、actor N, we get a new file have 1/N size.Exercise 2 (b)Histograms: This part of the lab is dedicated to image processing using histograms. A histogram is a statistical representation of the data within an image. The histogram can be represented as a plot of the frequency of each grey level. This rep

28、resentation shows the distribution of the image data values. By manipulating a histogram, it is possible to improve the contrast in an image and the overall brightness or to segment different areas of the image by applying one or more thresholds to the histogram itself. Implement a function to outpu

29、t the histogram values of a given grey level image. Display in the boxes the resulting histograms. LenaBaboonPeppersIf you normalize the values of the histogram so that they sum to 1, what does the value of a bin represent?Represent the probability of each grey levelExercise 2 (c)Equalize: Equalizat

30、ion is one of the possible image processing algorithms implemented using histograms. Histogram equalization allows use enhancing the contrast of images. Histogram equalization employs a monotonic, non-linear mapping which re-assigns the intensity values of pixels in the input image such that the out

31、put image contains a uniform distribution of intensities (i.e. a flat histogram). Implement a function that equalizes grey-scale images based on their histogram. The input is a given grey level image; the output is the derived image with uniform intensity distribution.Display in the boxes the equali

32、zed images and their histograms.Lene equalizedBaboon equalized Peppers equalizedLena histogram after equalizationBaboon histogram after equalization Peppers histogram after equalizationAre the distributions really uniform? Motivate your results.Not really. But the grey level a are more a distributed

33、 from 0 to 255 and the probability a are nearly a uniform.Show an example of successful application of histogram equalization to image enhancement. You can use an appropriate image of your choiceOriginal imageEnhanced imageComment the results of the previous step.The brightness and a contrast a are

34、increased.Exercise 2 (d)Histogram modelling: Histogram modelling techniques are effective tools for modifying the dynamic range and contrast of an image. Unlike , histogram modelling operators may employ non-linear and non-monotonic transfer functions to map between in the input and output images. I

35、n the first part of this lab you will model the histogram of a grey-scale image. Implement a point to point operation that maps the input grey level image into an output image which has a predefined frequency distribution. The algorithm is not given explicitly in the lecture slides, you are supposed

36、 to derive it. Use as input histogram the histogram of an image A and model the histogram of another image B according to the input. (A = Lena) (B=Peppers)Image AHisto of AImage BHisto of BB after Modelling Histo of B after modelling Use as input histogram an approximation of the exponential distrib

37、ution. Image PeppersHisto of PeppersPeppers after modellingHisto after modellingWrite in the box the formulation of your algorithm.I=imread(path);For i=1:255 E(i)=1.02(i);EndOutput=histeq(I,E);Exercise 3 (a)Negatives: We are used to the negative of an image in analogue image processing. It is possib

38、le to generate a negative from a digital image too. In the last part of todays lab you will solve a simple exercise on negative images.Write a function that inverts the grey level of a PGM image (e.g., it creates the negative of the image).Negative of BaboonNegative of PeppersNegative of LinaPerform

39、 the same task with PPM images and comment on the results.Negative of LinaNegative of PeppersNegative of BaboonYour comments:We can let a the max a value subtract the value a of each pixel. Like a grey pictures, I a use 255 subtract a each value of them.Exercise 3 (b)Rotation and translation. Image

40、processing toolboxes allow a user to rotate, translate and skew images. These are very useful operations for image composition, for example. The first exercise will cover the implementation of two of such transformations.Write a function BUPT_transform that takes as input an image I, rotates it with

41、 an angle 1 and skews it with a second angle, 2. Write the matrix formulation for image rotation (define all variables).Write the matrix formulation for image skewing (define all variables).Create and paste below a PGM image containing your name written in Arial font, point 72, uppercase letters.You

42、r image60120-50Rotate the image you created by 30, 60 120 and -50 degrees clockwise and display the results below.30Skew the same image by 10, 40 and 60 degrees and display the results below.604010During the developing process have you experienced the problem of regular patterns of black pixels in t

43、he image? If so, explain how you solved the problem. Otherwise imagine what could have generated these artefacts and how you would have worked around them.When a we move some pixels, some area of original a pictures may become a black. To solve that, we a can a cut a them a and save as .png Rotate t

44、he image by 20 degrees clockwise and then skew the result by 50 degrees. Display the result in a.Skew the image by 50 degrees and then rotate the result by 20 degrees clockwise. Display the result in b.abAnalyse the results when you change the order of the two operators i.e. R(S(I) and S(R(I), where

45、 R is the rotation and S is the skew. Are the results of (a) and (b) the same? Why? They are different. When change the sequence of a transformation, the transformation a matrics are a changed as well. Exercise 4 (a)Noise and PSNR: This part of the lab introduces error metrics for image quality evaluation. Two common metrics are the Mean Square Error (MSE) and the Peak Signal to Noise Ratio (PSNR). The MSE is the cumulative squared error between the processed image and the original image. The PSNR makes use of the MSE. The smaller the MSE, t

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号