-
Notifications
You must be signed in to change notification settings - Fork 0
/
ex1.m
73 lines (57 loc) · 1.41 KB
/
ex1.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
image = imread("ferrari.JPG");
image_not_scaled=image;
gamma =2.2;
image = im2double(image);
image_raw = image.^(gamma);
figure;
set(gcf, 'Units', 'Inches', 'Position', [0, 0, 16, 10]);
ax1=subplot(2,2,1);
%ax1.Position(3:4)=[300, 300];
imshow(image);
title("Original");
ax2=subplot(2,2,2);
%ax2.Position(3:4)=[300, 300];
imshow(image_raw);
title("RAW");
more_bright= (image_raw*2);
more_bright = imadjust(more_bright, [], [], 0.5);
%more_bright = rescale(more_bright);
%fprintf("max value: %d", max(more_bright));
ax3=subplot(2,2,3);
%ax3.Position(3:4)=[300, 300];
imshow(more_bright);
title("More Brightness");
more_contrast = image_raw.^1.8;
ax4 = subplot(2,2,4);
%ax4.Position(3:4)=[300, 300];
imshow(more_contrast);
title("More Contrast");
imwrite(new_image, "subplots.jpg");
figure;
subplot(1,3,1);
new_image_red=image_not_scaled;
new_image_red(:,:, 2:3)=0;
imshow(new_image_red);
subplot(1,3,2);
new_image_green=image_not_scaled;
new_image_green(:,:, 1)=0;
new_image_green(:,:, 3)=0;
imshow(new_image_green);
subplot(1,3,3);
new_image_blue=image_not_scaled;
new_image_blue(:,:, 1:2)=0;
imshow(new_image_blue);
new_image = image;
new_image(:,:, 1)=0.5;
new_image(:,:, 2)=0.5;
new_image(:,:, 3)=0.5;
%imshow(new_image);
%1.3
%histogram_plotter(image_not_scaled);
%figure;
%subplot(1,3,1);
%imhist(image_not_scaled(:,:,1));
%title("RED")
%imhist(image_not_scaled(:,:,2));
%subplot(1,3,1);
%imhist(image_not_scaled(:,:,3));