Uploaded by rajzadasamiii

Siganls and Image processing Assessment

advertisement
Name: Maria Hameed
Department: BSCIS
Assignment # 1: Signals and Image processing
Submitted to: Dr.Shahzad Ahmad Qureshi
Dated: 11 oct,2023
Task 1) Use any of the following software packages to change the light intensity in an image of your
choice: 3-D Studio Max Maya Cinema 4D IrfanView Write down the steps involved in changing the gray
levels.
Steps involved to attempt by Irfan View.
i.
Open the colored image in Irfan View
ii.
To convert this image to Irfan view you can either go to that option through the menu ->
Image/Convert to Gray Scale. Or you can do it directly using the keyboard shortcut Ctrl+G.
To adjust the light intensity I use color correction tool:
2) Insert a bitmap in MS Word document and change its gray levels.
Gray Scale Image :
Changing the color intensity by using the Corrections tool in the Picture Format menu. Here, a brightness
option allows to adjust brightness levels.
Task # 3: Load a picture in Matlab and find its intensity levels.
Steps :
i.
ii.
Load the picture using imread function and displaying it by using imshow
Checking Intensity Levels by viewing the distribution of image pixel intensities using the
imhist function
4) Use Paint program, make a picture of 64 X 64 pixels using gray scale?
Steps :
i.
ii.
iii.
iv.
First of all change the weight of canvas to 64 X 64
Select the "Color 2" option in the Colors section.
Choose a shade of gray by adjusting the color sliders or entering a grayscale value
Save the picture
Question # 5 : Locate Image Processing Toolbox in Matlab and use imread(‘filename’), imshow
(‘filename’), imwrite(A)
Steps involved:
i.
ii.
read the image by imread function
display it with imshow
write it in another file by ; > imwrite(img , 'C:\Users\hp\Downloads\my_image\cat.png');
iii.
This will write picture with cat Title in my_image folder.
iv.
Q# 6: Write a Matlab program for image negative by using the following two Matlab functions:
imshow(bw); imshow(~bw);
Matlab code :
image=imread('C:\Users\hp\Downloads\Cat Image.jpg');
>> if size(image,3)==3;
grayscale_image=rgb2gray(image);
else
grayscale_image=image;
end
>> nagative_image=~grayscale_image;
>> subplot(1,2,1);
>> imshow(grayscale_image);
>> title('Orignal_image');
>> imshow(nagative_image);
>> title('Nagative_image');
>> imshow(nagative_image);
>> imshow(grayscale_image);
>> subplot(1,2,2);
>> imshow(grayscale_image);
>> title('orignal_image');
>> imshow(nagative_image);
>>
Values of negative image
Values of original image
Steps involved
i.
ii.
I converted the previously loaded image (I) to grayscale by using the function rgb2gray(). I
then displayed this using the imshow(G) function.
Then I use ( ~ grayscale_image) and got this output.
iii.
Q # 7: Load color image and create its negative , and show it on the screen by writing a program in
Matlab?
Colored Image
Nagative of Above Image
8) Program in Matlab the following imshow(I, [low, high]); %remark I is a gray level image, use 10, 50 See
the effects on the intensity range.
Here I used the following code: imshow(G, [10, 50]) (on the previously converted gray-scale image) to
get the results..
Task 9: How to get number of gray levels in an intensity image? Find a tool (Hint: Paint, Photoshop,
Matlab, Python, R language may be used)?
Matlab code to get the gray level of an intensity image
if size(I, 3) = = 3 Grayscale_Img = rgb2gray(I);
end
unique_gray_levels = unique(Grayscale_Img); num_gray_levels = length(Grayscale_Img);
fprintf('Number of gray levels in the image: %d\n', num_gray_levels);
Task 10: Carry out all the tasks suggested under Assignment 1 heading in the handout of Chapter 1.
Give 3 examples for energy signals (continuous and discrete)?
Answer
Definition of Energy Signals
An energy signal, whether in continuous or discrete form, is characterized by the fact that its total energy
is finite. Mathematically, the energy, E, of a continuous signal x(t) is given by the integral of the squared
Continuous Energy Signals:
Impulse Signal: In the continuous domain, an impulse signal is an example of an energy signal. The
impulse is localized at a single point in time and has finite energy.
Exponential Decay Signal: An exponential signal that exponentially decays over time is another example
of a continuous energy signal. As long as the decay is fast enough, the signal will have finite energy.
Rectangular Pulse Signal: A rectangular pulse signal that is finite in duration and bounded in amplitude is
also an energy signal. The energy can be computed by integrating the squared value of the signal over its
time duration.
Discrete Energy Signal
Unit Sample Sequence: In the discrete domain, a unit sample sequence (also known as a discrete-time
impulse) is an example of a discrete energy signal. It consists of a single sample with finite energy.
Geometric Sequence: A geometric sequence that converges, such as a decaying exponential sequence in
discrete time, is a discrete energy signal. The energy can be computed by summing the squares of its
terms.
Rectangular Sequence: A finite-length rectangular sequence in discrete time, similar to the continuous
rectangular pulse, is also a discrete energy signal. The energy is computed by summing the squares of its
values over the sequence.
. Give 3 examples for power signals (continuous and discrete)
AnsPower Signals are signals where the average power is finite and non-zero, but the total energy is
infinite. Here are examples of power signals in both continuous and discrete domains:
Continuous Power Signals:
Sine Wave: A continuous power signal example is a sinusoidal signal.
Periodic Square Wave: Another example of a continuous power signal is a periodic square wave.
Periodic Triangular Wave: A periodic triangular wave is also considered a continuous power signal.
Discrete Power Signals:
Discrete Sinusoidal Sequence: In the discrete domain, a discrete sinusoidal sequence is an example of a
power signal.
Periodic Square Sequence: A periodic square sequence is another instance of a discrete power signal.
Periodic Triangular Sequence: A periodic triangular sequence in discrete time is also classified as a power
signal.
In these cases, while the average power is finite, the total energy remains infinite
.4. Is there any signal which is neither a power signal nor an energy signal? Find two examples.
Ans) The Unit Step Function possesses infinite energy because it maintains a non-zero value for all
positive arguments. Another function with similar characteristics is the Ramp Function, denoted as r(t) =
t.u(t), where t is time and u(t) is the unit step function.
The Unit Step Function and the Ramp Function both have non-zero values that extend indefinitely for
positive arguments, resulting in their infinite energy characteristics.
5. State whether energy and power signals are periodic or aperiodic?
Ans) Energy signals are aperiodic, whereas power signals are periodic.
Energy Signals: Energy signals are typically aperiodic, which means they are non-periodic and do not
repeat themselves over time. These signals have finite energy, but their behavior does not exhibit regular
repetitive patterns. A common example of an aperiodic signal is non-periodic noise.
Power Signals: Power signals can be either periodic or aperiodic. Periodic power signals are those that
repeat themselves over time and have finite power. An example of a periodic power signal is a
continuous sine wave. Aperiodic power signals, on the other hand, do not repeat themselves and also
have finite power. An example of an aperiodic power signal is a finite-length pulse.
6. x 1 (t) time period is T1 , x 2 (t ) time period is T2.How to get the following signal: x1 (t) + x 2 (t)
Ans)
Combining signals can be done in either the time domain or the frequency domain
We can add the two signals together in the time domain or in the frequency domain.
Time Domain
y(t) = x1(t) + x2(t)
where y(t) is the sum of the two signals.
Frequency Domain
In the frequency domain, we can add the two signals together using the
following equation:
Y(f) = X1(f) + X2(f)
where Y(f) is the Fourier transform of y(t), and X1(f) and X2(f) are the Fourier
transforms of
x1(t) and x2(t), respectively.
7. Find the size of the 256 color images with a resolution of
- 640 X 480
- 800 X 600
- 1024 X 768
Ans)
i.
For a 640 x 480 image:
Size = 640 × 480 × (256 / 8) = 9830400 bytes
ii.
For an 800 x 600 image:
Size = 800 × 600 × (256 / 8) = 15360000 bytes
iii.
For a 1024 x 768 image:
Size = 1024 × 768 × (256 / 8) = 25165824 byte
Download