Discrete Cosine Transform.
a. On the 256x256 grayscale image kobi.png, calculate the
two-dimensional Discrete Cosine
Transform using dct2. Output the results: the input image, and the
DCT image.
b. Take the DCT image in (a), and apply the two-dimensional inverse
DCT image. Subtract that from
the original kobi.png image, and plot the image of the absolute
value of the differences. Does the
entire image have zero values? Why not?
%Following commands or program used is given below
im=imread('kobi.png') %Reading the image
imr=imresize(im,[256 256]) % Resizing of the image if the size is not 256X256
figure(1), imshow(imr)
imd=dct2(imr) %It Computes IDCT of the image
imshow(imd) %It Shows DCT of the image
imid=idct2(imd) %It Computes Inverse DCT of the image
imshow(imid) %It shows Inverse DCT of the image
diff=imr- uint8(imid) % It compute difference between resized image and Inverse DCT image
imshow(diff) % It shows difference between DCT image and Inverse DCT image
Explanation
Does the entire image have zero values?
No .
Why not?
DCT is Lossy compression. Hence the expected values in Reconstructed image (IDCT) will not be exactly the same as the original due to loss during computation of DCT image. However, error is within some margin
Discrete Cosine Transform. a. On the 256x256 grayscale image kobi.png, calculate the two-dimensional Discrete Cosine Transform...
Write a program in MATLAB to compute the 1-dimensional discrete cosine transform (1D - DCT) of a signal.
Problem 3. Extensive experimental evidence in the area of image compression has shown that the Discrete Cosine Transform (DCT) of image patches is a very good approximation to their PCA. It is also well known that all but one of the DCT coefficients (features) have zero mean, and only one has non-zero mean. The latter is the so-called DC coefficient because it results from projecting the image patch into the vector 1 = (1, 1, , 1)T and, therefore, is...
Use MATLAB please! Write a function myDFT that performs the discrete Fourier transform for a signal y(t) sampled at regular time intervals. The function shall take as input the vector of instances in time measurements were taken t and the vector of measured values y. As output the function shall provide the variable a0 representing ao and the vectors a and b containing ak and bk from the discrete Fourier transform (a does not include ao whi is returned in...
Given two 2-dimensional arrays, A and B, calculate the three arrays: A + B, A*B and A*B-1 . That is to say find the sum of the two arrays, the outer-product of the two arrays and the outer-product of A times B inverse. You can use the procedure illustrated on the web site: https://www.thecrazyprogrammer.com/2017/02/c-c-program-find-inverse-matrix.html (Links to an external site.) make the arrays 3X3, choose any values you wish make sure the determinant of B is not zero, if so change...
Part I: Black Box A Design your first black box adhering to the following specifications A. Input Signal to Black Box A 1. A 1 kHz cosine wave with amplitude of 1V. B. Output Signal from Black Box A 1. A 1 kHz sine wave with amplitude of Hint: Use an ideal op-amp C. Explain your design process. What type of circuit did you design? Discuss D. Why did vou use an op-amp? Could another component be used instead? Why...
this is Matlab. Three images are consecutive and connected. I NEED PROBLEM 2 Chapter 6 Programming in Matlab Week 6 THE ALTERNATING HARMONIC SERIES The alternating harmonic series converges to the natural log of 2 +--...-In(2) = 0.6931471806 -1--+ Because of this, we can use the alternating harmonic series to approximate the In(2). But how far out do you have to take the series to get a good approximation of the final answer? We can use a while loop to...
This is taken from Section 4.6, "Amplitude Modulation and the Continuous-Time Fourier Transform," in the course text Computer Explorations in signals and systems by Buck, Daniel, Singer, 2nd Edition. I need the answers for the basic and intermediate questions. 4.6 Amplitude Modulation and the Continuous-Time Fouriei Transform This exercise will explore amplitude modulation of Morse code messages. A simple ampli tude modulation system can be described by x(t) = m(t) cos(Crfot), (4.13) where m(t) is called the message waveform and...
Corporate advertising tries to enhance the image of the corporation. A study compared two ads from two sources, the Wall Street Journal and the National Enquirer. Subjects were asked to pretend that their company was considering a major investment in Performax, the fictitious sportswear firm in the ads. Each subject was asked to respond to the question "How trustworthy was the source in the sportswear company ad for Performax?" on a 7-point scale. Higher values indicated more trustworthiness. Here is...
questions 1, 2, 3, 4, and 5 with data below. Lenses and Mirrors: Insight into Eyesight- our eyes and car mirrors. Part 1. Measure the object and image distances to find the focal distance and magnification for two convex lenses and 1 convex mirror. Table 12-1a. Measure the object and image distance to find the principal foaal distance and magnification. Lens 1 Object Distance Image DistancePrincipal Fo Magnification Length f(m) M-dvd N/A- 9./2 O.IS O-lo 4 0-4 0.2 o.1o 023...
Greeting! Kindly help me to solve my finals in PYTHON, I don't have a knowledge in PYTHON, new student. Please, please, I'm begging, Kindly answers all the questions. I'm hoping to grant my request. Thanks in advanced. 1.) What is the output of the following snippet? l1 = [1,2] for v in range(2): l1.insert(-1,l1[v]) print(l1) a.) [1, 2, 2, 2] b.) [1, 1, 1, 2] c.) [1, 2, 1, 2] d.) [1,...