1
00:00:00,060 --> 00:00:01,650
Hi and welcome back to the course.

2
00:00:02,070 --> 00:00:06,390
So, listen, we're going to take a look at now is implementing tilt shift effects.

3
00:00:06,870 --> 00:00:10,890
So many of you may not know it till till the shift affects us.

4
00:00:11,310 --> 00:00:16,380
So this is to open the book here to download your images and important functions.

5
00:00:16,470 --> 00:00:17,520
We actually don't.

6
00:00:18,210 --> 00:00:24,570
Oh, this is probably still saw this before, but if you have too many notebooks, open call up tells

7
00:00:24,570 --> 00:00:25,220
you that you can have.

8
00:00:25,240 --> 00:00:26,520
You can't have more than five open.

9
00:00:27,000 --> 00:00:28,600
So it tells you that you have to to me some.

10
00:00:28,640 --> 00:00:30,240
So we're finished with all of these here.

11
00:00:30,240 --> 00:00:37,250
So let's go ahead and terminate all the previous lessons that we were running before and close this.

12
00:00:37,250 --> 00:00:40,830
So now we can run our code and load our stuff.

13
00:00:41,340 --> 00:00:43,950
We don't need to live here anymore, so let's just get rid of it.

14
00:00:47,610 --> 00:00:50,550
And there we go, so everything should be imported now.

15
00:00:50,580 --> 00:00:51,060
There we go.

16
00:00:51,810 --> 00:00:59,940
So tilt shift before I go to this good tilt shift is an effect that takes our normal standard image,

17
00:01:00,000 --> 00:01:06,840
usually off like landscape of a city or top down something just that's pretty and actually makes it

18
00:01:06,840 --> 00:01:08,610
look like it's a miniaturized model.

19
00:01:09,180 --> 00:01:11,730
Now, how does it make it look like a miniaturized model?

20
00:01:12,210 --> 00:01:17,910
It does that by sort of focusing on certain areas and then blurring certain areas, sort of like the

21
00:01:17,910 --> 00:01:23,370
fake bulkier book, the photography term for lens blur.

22
00:01:23,400 --> 00:01:29,610
So when you have a low aperture like an aperture of f 1.8 or 2.4, the the focal point.

23
00:01:29,610 --> 00:01:32,010
Let's say you're focusing on an object or a fierce that's close.

24
00:01:32,550 --> 00:01:38,430
That remains in focus because the narrow focal plane there, but everything else behind it is very blue,

25
00:01:38,520 --> 00:01:38,870
Larry.

26
00:01:39,330 --> 00:01:44,750
And that's a good effect as affected photographers want because it sort of looks like it looks nice,

27
00:01:44,770 --> 00:01:45,900
looks high quality.

28
00:01:46,290 --> 00:01:50,520
The fierce, super sharp background is blurry, so it brings a face into focus.

29
00:01:51,330 --> 00:01:57,270
So that's what that's what blurring the subtle shift is the type of effect that implements this blur

30
00:01:57,780 --> 00:02:01,200
in the foreground of the image and sort of lives.

31
00:02:01,270 --> 00:02:01,980
Background a bit.

32
00:02:02,400 --> 00:02:10,260
But it does it in a way where we kind of have basically miniaturized model look effects, which you

33
00:02:10,260 --> 00:02:13,290
will see literally outputs instead of just talking about it.

34
00:02:13,770 --> 00:02:14,700
Let's take a look.

35
00:02:15,130 --> 00:02:16,440
The outputs, let's scroll down.

36
00:02:16,770 --> 00:02:20,790
This good is fairly low because it's very well commented, but it's not that complicated.

37
00:02:21,600 --> 00:02:22,980
So this is the original image here.

38
00:02:23,940 --> 00:02:24,570
Whoops.

39
00:02:24,780 --> 00:02:25,350
What did I do?

40
00:02:26,940 --> 00:02:30,030
Sorry, but it's not sure why it's scroll all the way up to the top.

41
00:02:30,540 --> 00:02:36,780
So this here this is the original image, and you can see now in the tilt tilt shift effect.

42
00:02:36,780 --> 00:02:41,340
That image you can see here is much more blurred, whereas here is in focus.

43
00:02:41,340 --> 00:02:43,950
So it sort of gives you the impression of that.

44
00:02:43,950 --> 00:02:47,580
This is a miniature model that actually does look like that to me.

45
00:02:48,150 --> 00:02:50,880
So this is a pretty cool implementation of it.

46
00:02:51,660 --> 00:02:53,000
Next, we have these boats here.

47
00:02:53,010 --> 00:02:56,440
This is the original image, and this is a tool shift image.

48
00:02:56,530 --> 00:03:02,250
Less effective on this one because you can see this blue here and only here in focus, but nevertheless,

49
00:03:02,250 --> 00:03:03,630
it's a cool effect.

50
00:03:04,200 --> 00:03:06,240
So how does this work?

51
00:03:06,310 --> 00:03:07,650
So let's take a look at the code.

52
00:03:07,890 --> 00:03:09,180
So let's scroll up to the top.

53
00:03:10,440 --> 00:03:12,270
So the court has many helper functions.

54
00:03:12,270 --> 00:03:14,280
Has this generating canola?

55
00:03:14,280 --> 00:03:17,280
Reducing the image has expanding.

56
00:03:17,280 --> 00:03:19,290
I'm not going to go through all of these in detail.

57
00:03:20,040 --> 00:03:21,220
It's very well commented.

58
00:03:21,240 --> 00:03:24,570
So if you want, you can actually go through this code on your own and your one time.

59
00:03:25,110 --> 00:03:31,650
It may take you about a half hour to fully understand every single thing, but it's a very good exercise

60
00:03:31,650 --> 00:03:32,010
to do.

61
00:03:32,850 --> 00:03:39,930
So there's this Gaussian pyramid, which takes the images and generates different levels of skilling

62
00:03:40,590 --> 00:03:45,270
is to the +Y and pyramid this over here.

63
00:03:45,360 --> 00:03:50,340
And then there's a blend function, which blends Le Plus Jeune pyramids by weaving them according to

64
00:03:50,340 --> 00:03:51,300
the Gaussian mass.

65
00:03:51,780 --> 00:03:54,570
So it's complicated, but it's actually not super complicated.

66
00:03:55,950 --> 00:03:59,070
I am not going to go through this anecdote because it can get quite lengthy.

67
00:03:59,580 --> 00:04:01,050
However, it's a good exercise.

68
00:04:01,070 --> 00:04:06,360
The point of this lesson is to demonstrate how we can do it and not all of the background functions

69
00:04:06,360 --> 00:04:06,960
that does it.

70
00:04:07,470 --> 00:04:08,610
So apologies for that.

71
00:04:08,640 --> 00:04:16,340
However, if you do want a more detailed explanation of this, just message me on Udemy or just of posted

72
00:04:16,350 --> 00:04:20,040
in the student forum, and I'll try my best to explain it to you guys.

73
00:04:20,610 --> 00:04:25,800
There's this run blend function here dysfunction administrators, the blending of the two images, according

74
00:04:25,800 --> 00:04:26,550
to the mask.

75
00:04:27,270 --> 00:04:32,090
And then we get the images here, which is basically contains images from the fall.

76
00:04:32,100 --> 00:04:35,430
That's a pretty, pretty long function just to do something that's a bit simple.

77
00:04:36,150 --> 00:04:41,290
And we have a main function which implements the outer rim basically here.

78
00:04:41,310 --> 00:04:47,190
So we just give the images and the source will show the original image, play print, applying the lending.

79
00:04:48,030 --> 00:04:53,460
Then we just convert the types, get the channels, run blend, which takes this here.

80
00:04:53,940 --> 00:04:57,930
These inputs, the mask as well gets the outputs here.

81
00:04:57,960 --> 00:05:01,970
Outliers sit here, then merges them together because we have multiple images.

82
00:05:01,980 --> 00:05:06,670
Now we're moving to get the final effect and then we display the right image save.

83
00:05:06,670 --> 00:05:09,030
So we save it and then we display of here.

84
00:05:09,150 --> 00:05:12,730
So that's the end of this lesson, and I hope you enjoyed.

85
00:05:12,730 --> 00:05:15,180
I hope you have fun implementing tools of wide open TV.

86
00:05:15,570 --> 00:05:21,840
It's quite cool, and it's a very, very good exercise to read through this code in detail and understand

87
00:05:21,840 --> 00:05:26,940
all of the nitty-gritty if you want to get a deeper understanding of classical computer vision techniques.

88
00:05:27,630 --> 00:05:29,100
So that's it for this lesson.

89
00:05:29,280 --> 00:05:34,860
Let's move on now to listen to DX, which is using the grab cuts algorithm for background removal.

90
00:05:35,280 --> 00:05:35,790
Very cool.

91
00:05:35,790 --> 00:05:36,150
Listen.

92
00:05:36,240 --> 00:05:38,010
So I'll see you in that section.

93
00:05:38,160 --> 00:05:38,630
Thank you.
