1
00:00:00,540 --> 00:00:01,800
Hi and welcome back.

2
00:00:01,830 --> 00:00:08,340
So Intersection will take a look at what exactly are images and how what is stored digitally on a computer.

3
00:00:08,970 --> 00:00:10,830
So let's take a look at the next slide.

4
00:00:11,370 --> 00:00:13,560
This is how a computer actually sees images.

5
00:00:14,010 --> 00:00:20,250
What we're seeing here is basically an array of different numbers and of color coded them specifically

6
00:00:20,250 --> 00:00:21,540
as blue, green and red.

7
00:00:21,570 --> 00:00:27,510
That's the RGV color spectrum and how we represent all colors by combinations of these three colors.

8
00:00:28,200 --> 00:00:34,290
So an image will basically be tree values per pixel, and each pixel is represented.

9
00:00:34,290 --> 00:00:35,610
Like this point here?

10
00:00:35,640 --> 00:00:40,560
This pixel zero zero, this is also pixel zero zero, and this is also pixel zero zero.

11
00:00:40,950 --> 00:00:48,300
And in order to get the actual color of what Pixel zero is, we have to mix different amounts of red,

12
00:00:48,420 --> 00:00:49,530
green and blue.

13
00:00:50,040 --> 00:00:54,780
And you can see if you look carefully, it's a bit hard to see, but there are values here and the values

14
00:00:54,780 --> 00:00:56,460
range from zero to 255.

15
00:00:57,210 --> 00:01:04,860
What that means is that 255 will be the most intense representation of the color red, whereas one or

16
00:01:04,890 --> 00:01:06,420
two will be a very dark red.

17
00:01:06,450 --> 00:01:08,730
Whereas what 255 is the bright red?

18
00:01:09,630 --> 00:01:12,910
So that's how the digital images are stored.

19
00:01:12,930 --> 00:01:15,300
But what exactly are images?

20
00:01:15,360 --> 00:01:21,030
Well, images are basically 2D representations of the visible light spectrum.

21
00:01:21,480 --> 00:01:25,050
And that's basically a part of the electromagnetic spectrum here.

22
00:01:25,050 --> 00:01:28,200
The visible part of this, this small little orange right here.

23
00:01:28,770 --> 00:01:34,800
And there's other electromagnetic spectrums here ultraviolet X-ray, gamma rays, microwave radio,

24
00:01:34,800 --> 00:01:36,360
all of these things we can't see.

25
00:01:36,360 --> 00:01:40,140
Our eyes are only tuned to see this one visible light spectrum.

26
00:01:40,500 --> 00:01:47,730
And as I just showed you before, each pixel like pixel zero here zero zero, the top left one is a

27
00:01:47,730 --> 00:01:51,210
mix of these three colors in the RGV color space.

28
00:01:51,690 --> 00:01:58,260
And when you combine different amounts of them to generate any color we want, and that gives us basically

29
00:01:58,260 --> 00:01:59,490
how an image is formed.

30
00:01:59,820 --> 00:02:03,690
So our images created do well.

31
00:02:03,690 --> 00:02:08,850
This goes into camera photography theory, where you can take a look and see how we have to.

32
00:02:08,850 --> 00:02:15,090
We have to basically focus light from an object that that's been reflected from an object, basically

33
00:02:15,090 --> 00:02:22,230
true a pinhole here that is now focused onto a thumb or photosensitive sensor, and that basically forms

34
00:02:22,230 --> 00:02:22,860
the image.

35
00:02:23,010 --> 00:02:25,590
But however, this is basically a very primitive model.

36
00:02:26,040 --> 00:02:26,580
We need it.

37
00:02:26,760 --> 00:02:28,590
Basically, what modern cameras do?

38
00:02:28,650 --> 00:02:29,580
We need a lens?

39
00:02:30,000 --> 00:02:36,240
And this lens focuses the image here onto the film now in order for it to be focused.

40
00:02:36,420 --> 00:02:41,100
This needs to be at a specific distance to get the focus right where all these areas are concentrated

41
00:02:41,100 --> 00:02:41,370
here.

42
00:02:42,480 --> 00:02:48,450
But basically, by adjusting the lens, we can adjust the width that basically gives us different zooms

43
00:02:48,690 --> 00:02:51,000
as well as different apertures as well.

44
00:02:51,000 --> 00:02:52,780
That's the opening to what the lens here.

45
00:02:53,100 --> 00:02:58,410
So there's a number of different combinations we can use to focus and move this lens to get the image

46
00:02:58,410 --> 00:03:01,950
onto the film so digitally.

47
00:03:01,950 --> 00:03:08,000
As I showed you before, images are basically combinations of red, green and blue in OpenCV.

48
00:03:08,400 --> 00:03:10,860
You'll you'll see a format called BGR.

49
00:03:11,280 --> 00:03:15,510
It's the same as RGV, but it's still within the BGR order for some reason.

50
00:03:15,540 --> 00:03:18,270
Actually, there's a reason, but it's a bit technical to explain.

51
00:03:18,870 --> 00:03:24,360
So as you can see something like the color yellow here, color yellow is represented by mixing red and

52
00:03:24,360 --> 00:03:25,220
green only.

53
00:03:25,230 --> 00:03:30,270
So you can see just 255 T-55 here on red and green will give us the color yellow.

54
00:03:31,350 --> 00:03:36,870
So that's basically how we use the RGV color spectrum to represent images.

55
00:03:37,110 --> 00:03:42,150
So let's take a bit of a deeper look into how it's actually stored on a computer.

56
00:03:42,690 --> 00:03:46,380
So computers have things called variables.

57
00:03:46,830 --> 00:03:54,240
Variables can be integers can be a string string, meaning a piece of text, and then you can have arrays

58
00:03:54,240 --> 00:03:58,740
and arrays of basically a container that store multiple values.

59
00:03:59,280 --> 00:04:03,630
So a one dimensional array can store any amount of values.

60
00:04:03,810 --> 00:04:10,350
Basically, just consider a container in compartments and you can have different values in this compartments

61
00:04:10,350 --> 00:04:10,680
here.

62
00:04:10,800 --> 00:04:14,940
So this is what a one dimensional area looks like a two dimensional early.

63
00:04:15,420 --> 00:04:16,530
We'll just look like this.

64
00:04:16,680 --> 00:04:18,720
You can see it's basically a grid now.

65
00:04:19,290 --> 00:04:26,800
So you can have different reference values going on zero zero zero one one to five to reference the

66
00:04:26,880 --> 00:04:27,750
different points here.

67
00:04:27,780 --> 00:04:29,790
That's what the 2D array looks like.

68
00:04:30,180 --> 00:04:35,190
Now, this is a good example to show you what a tree dimensional area would look like, and that's how

69
00:04:35,190 --> 00:04:37,290
color images will be stored.

70
00:04:38,280 --> 00:04:42,750
So as you can see, for the position zero zero in disarray, we have tree values.

71
00:04:43,140 --> 00:04:45,070
That's what I mentioned several times before.

72
00:04:45,090 --> 00:04:47,040
It's just a way to help you visualize it better.

73
00:04:47,580 --> 00:04:52,260
So that's how an image is actually stored on a computer to basically look up.

74
00:04:52,620 --> 00:04:54,660
When I see a computer, I mean, programming language.

75
00:04:54,660 --> 00:04:56,310
It's actually stored in memory addresses.

76
00:04:56,760 --> 00:04:58,470
I'm not going to go down into that low level.

77
00:05:00,410 --> 00:05:05,300
To and Sophie, to understand how it's stored, but in a programming language like Python, this is

78
00:05:05,300 --> 00:05:07,580
the best way to understand what's going on.

79
00:05:08,180 --> 00:05:10,760
So 2D images are actually different.

80
00:05:11,090 --> 00:05:14,600
They're stored in two dimensional arrays, and they only have one value.

81
00:05:15,020 --> 00:05:17,810
They don't have to be different values, as you see here.

82
00:05:18,380 --> 00:05:22,640
The one value is basically basically a range of green.

83
00:05:23,060 --> 00:05:28,490
So zero will be black effectively and 255 would be white.

84
00:05:28,610 --> 00:05:32,060
And all the numbers in between will be different.

85
00:05:32,270 --> 00:05:33,470
Different shades of grey.

86
00:05:33,950 --> 00:05:35,070
Not 50 shades of grey.

87
00:05:35,120 --> 00:05:37,130
255 shades of grey.

88
00:05:38,030 --> 00:05:40,580
So that's the greyscale representation.

89
00:05:40,580 --> 00:05:43,910
Grayscale could be colloquially called black and white.

90
00:05:44,060 --> 00:05:48,710
So whenever you hear black and white, people don't tend to mean grayscale images.

91
00:05:49,430 --> 00:05:55,250
And lastly, we'll take a look at image file formats so you can have a jpeg, jf png.

92
00:05:55,850 --> 00:05:57,950
We can look at all of these into open KB.

93
00:05:58,010 --> 00:06:01,100
I don't believe we can look TIFF or actually TIFF might work.

94
00:06:01,610 --> 00:06:03,720
Raw may not work or these may not work.

95
00:06:03,740 --> 00:06:05,060
These are Photoshop files.

96
00:06:05,540 --> 00:06:07,040
These are just common image types.

97
00:06:07,520 --> 00:06:10,850
No, these are raster image types I should have specified at before.

98
00:06:11,330 --> 00:06:12,080
These are different.

99
00:06:12,080 --> 00:06:19,760
These are pixel based resolution, fixed dependent images where we have each pixel has a color value

100
00:06:19,760 --> 00:06:20,390
assigned to it.

101
00:06:21,020 --> 00:06:22,850
No vector images are different.

102
00:06:23,210 --> 00:06:26,870
Now we don't deal with vector images in this course, but it's important for you to understand the different

103
00:06:26,870 --> 00:06:28,930
types of images with image formats.

104
00:06:28,940 --> 00:06:33,680
If you're doing computer vision so you can have SVG, which is a very good one.

105
00:06:34,130 --> 00:06:42,290
If Adobe Illustrator PDFs as well are set to be as effective as meaning that they aren't their resolution

106
00:06:42,290 --> 00:06:42,930
independent.

107
00:06:42,950 --> 00:06:44,630
So what are you screwing it up?

108
00:06:45,020 --> 00:06:47,810
It isn't to lose quality like the rest of the image would.

109
00:06:48,540 --> 00:06:51,470
So that's it for this lesson on images.

110
00:06:51,830 --> 00:06:53,500
Now you're ready to start the course.

111
00:06:53,510 --> 00:06:57,680
So let's get started with Google collab and set up this download.

112
00:06:57,680 --> 00:07:03,200
Of course, good in the next section and set up Google Club Environment for Google Cloud, which is

113
00:07:03,200 --> 00:07:03,800
quite simple.

114
00:07:04,250 --> 00:07:05,820
So I'll see you in the next lesson.

115
00:07:05,840 --> 00:07:06,680
Thank you for watching.
