1
00:00:00,060 --> 00:00:06,070
So welcome to the next section where we take a look at detecting blur in images, so open this notebook

2
00:00:06,090 --> 00:00:07,350
and let's begin to listen.

3
00:00:08,310 --> 00:00:10,350
So firstly, let's think about something.

4
00:00:11,010 --> 00:00:12,600
What exactly is blue?

5
00:00:13,380 --> 00:00:19,260
Now you instinctively know if you move your phone, camera or any camera fast when you're taking a picture

6
00:00:19,260 --> 00:00:25,890
or using a manual camera and you increase the shutter speed and you get the camera when taking the picture,

7
00:00:25,890 --> 00:00:27,870
you're going to get blurry photo.

8
00:00:27,900 --> 00:00:33,060
I mean, that's intuitive, and you understand that everyone should understand how blurry photos are

9
00:00:33,060 --> 00:00:34,500
right now.

10
00:00:35,550 --> 00:00:39,270
How do you mentally or visually tell when a picture is blurry?

11
00:00:39,840 --> 00:00:43,320
You can tell when a picture is buried, when the edges undefined.

12
00:00:43,950 --> 00:00:45,910
That's basically what's happening to the image.

13
00:00:45,930 --> 00:00:46,860
That's why it's blurry.

14
00:00:47,340 --> 00:00:54,660
So to detect the basically the amount of edges in an image can basically tell us know how strong the

15
00:00:54,660 --> 00:00:57,960
edges of an image can tell us how sharp that images.

16
00:00:58,470 --> 00:01:04,170
So to do that, we actually just use the simple convolution operation within the policy.

17
00:01:04,180 --> 00:01:06,990
And Colonel sounds a bit technical, but it's not that technical.

18
00:01:07,350 --> 00:01:09,870
Then the plastic is the second derivative of an image.

19
00:01:10,200 --> 00:01:15,240
So it highlights the areas of rapid intensity changes like an edge or corner.

20
00:01:15,840 --> 00:01:19,230
So that's why we can tell with a high variance in it.

21
00:01:20,850 --> 00:01:25,410
We should be able to detect edge like when known as like type things in the image.

22
00:01:25,770 --> 00:01:31,830
So a low variance basically tells us that there are very little edges, meaning that it might be blurred.

23
00:01:32,850 --> 00:01:35,670
And then basically the opposite is true a high variance with loss.

24
00:01:35,670 --> 00:01:38,820
There's a lot more edges in the image and the image is shop.

25
00:01:39,240 --> 00:01:45,510
OK, so let's look LoDo images and load the function and see delivery, which I've already done here.

26
00:01:46,240 --> 00:01:49,350
And now let's apply some blue to some images.

27
00:01:49,860 --> 00:01:51,810
So I'm going to load an image here.

28
00:01:52,350 --> 00:02:00,270
It's of the Liberty Store in London, which I was in just a few weeks ago, and it's actually a pretty

29
00:02:00,270 --> 00:02:01,710
nice Christmas store.

30
00:02:01,750 --> 00:02:08,040
I mean, has a good look good, a good Christmas section right now, which is why I was still so we

31
00:02:08,040 --> 00:02:10,470
can take a look and you can see this is the original image here.

32
00:02:11,100 --> 00:02:16,170
It looks decently sharp notices semblance a little bit of blue ribbon not to worry.

33
00:02:16,620 --> 00:02:19,860
This one is a bit mulberry can tell, and this one is the most fluid.

34
00:02:20,700 --> 00:02:22,560
You can definitely see it looks quite smudgy.

35
00:02:22,610 --> 00:02:24,780
Now, these aren't that badly blurred, to be fair.

36
00:02:25,170 --> 00:02:26,410
But what we're going to do?

37
00:02:26,430 --> 00:02:31,380
These are subtle changes in the blurriness of the image, which is why we intentionally did that.

38
00:02:31,890 --> 00:02:37,950
So we're going to create we're going to create a function where we return to LA plus yellow often.

39
00:02:37,950 --> 00:02:38,610
Image here.

40
00:02:38,730 --> 00:02:40,470
So a grayscale of the image.

41
00:02:41,010 --> 00:02:42,630
So we get, well, actually, it's not.

42
00:02:42,630 --> 00:02:43,650
It doesn't have to be grayscale.

43
00:02:44,160 --> 00:02:45,360
I mean, it does have to be grayscale.

44
00:02:45,750 --> 00:02:51,750
But this function, if it's a colour grayscale or color image, do it because if it's a colour image,

45
00:02:51,750 --> 00:02:57,050
it us detects that it has three dimensions in it and then applies the grayscale if it's to, if there's

46
00:02:57,060 --> 00:02:58,860
everything else should be grayscale.

47
00:02:59,700 --> 00:03:02,370
So and a return to the plus in right here.

48
00:03:02,760 --> 00:03:04,080
That's basically the list school.

49
00:03:04,770 --> 00:03:07,050
Plus the invariance can see the dot fire function here.

50
00:03:07,770 --> 00:03:13,200
So remember, remember that was our definition of it, of getting a blue school.

51
00:03:13,590 --> 00:03:20,880
So now just to find the function and you can see the Burscough is there, but let's run this again and

52
00:03:20,880 --> 00:03:23,280
you can see for the first original image of the high.

53
00:03:23,370 --> 00:03:29,310
The score is the variance is very high, which means that there a lot of edges in the original image

54
00:03:29,700 --> 00:03:31,440
and you can tell you can see you can see it this.

55
00:03:31,680 --> 00:03:37,260
It's quite distinctive schism, and there's a lot of little edges here in between, which is why I use

56
00:03:37,260 --> 00:03:40,170
this picture and then continue to bleed ones.

57
00:03:40,170 --> 00:03:42,750
It just continuously looks less and less.

58
00:03:42,780 --> 00:03:46,620
You can see there's almost no definition with the little inner parts of it here.

59
00:03:47,250 --> 00:03:52,920
And last one is heavily blurred and you can see how different the blue skies are.

60
00:03:53,490 --> 00:03:53,790
You can.

61
00:03:53,880 --> 00:03:59,370
So this is a very good way of detecting the shopper's image in the batch, and I've used this function

62
00:03:59,910 --> 00:04:07,170
in license plate OCR reader previously, where it captures about, let's say, roughly three seconds

63
00:04:07,170 --> 00:04:10,350
or even two seconds of a license plate passing an image.

64
00:04:10,680 --> 00:04:17,460
And it uses a combination of the largest and sharpest image to run the OCR detector on it.

65
00:04:17,760 --> 00:04:23,940
So it's definitely improved reliability of that license plate reader that that was actually for the

66
00:04:23,940 --> 00:04:29,760
research paper I was working on that basically used a few of the cutting edge techniques to do something

67
00:04:29,760 --> 00:04:37,170
simple, which is license plate reading, so that research paper may be out in early 2022.

68
00:04:37,740 --> 00:04:41,640
So if it is, hopefully you guys can read it and critique it if you want.

69
00:04:42,600 --> 00:04:43,920
So that's it for that lesson.

70
00:04:44,400 --> 00:04:51,300
We're now going to do facial recognition using some pretty cool libraries that make it much easier for

71
00:04:51,300 --> 00:04:51,780
us to do.

72
00:04:52,110 --> 00:04:56,460
We're actually going to do this and a lot more detail later on in the deep learning section.

73
00:04:56,460 --> 00:04:59,880
But for now, we're going to use a standard library that makes it quite easy.

74
00:05:00,010 --> 00:05:02,800
US, so I'll see you in the next lesson.

75
00:05:03,010 --> 00:05:03,460
Thank you.
