File size: 4,111 Bytes
17e2002 | 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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | 1
00:00:00,780 --> 00:00:02,500
So let's talk a bit about transitions.
2
00:00:02,550 --> 00:00:07,080
Transitions are actually very simple and it's basically moving an image in one direction can be left
3
00:00:07,080 --> 00:00:09,400
right up down or even diagonally.
4
00:00:09,400 --> 00:00:13,020
If you implement an x and y traslation at the same time.
5
00:00:13,380 --> 00:00:19,950
So to perform a translation we actually use Open see these C-v to walk a fine function but that function
6
00:00:19,950 --> 00:00:23,250
requires what we call the translation matrix.
7
00:00:23,250 --> 00:00:29,280
So we are getting into too much high school geometry a translation matrix basically is is in this form
8
00:00:29,780 --> 00:00:33,020
and takes an x and y value as these elements here.
9
00:00:33,450 --> 00:00:39,570
Now what misrepresents here is a shift along the x axis horizontally and Y is shift along the y axis
10
00:00:39,570 --> 00:00:40,370
vertically.
11
00:00:40,590 --> 00:00:43,180
And these are the directions each shift takes place.
12
00:00:43,360 --> 00:00:50,130
So images all the start of being at the top left corner and retranslated in any direction using the
13
00:00:50,130 --> 00:00:51,680
transition matrix here.
14
00:00:51,750 --> 00:00:53,660
So let's implement this and quite quickly.
15
00:00:55,760 --> 00:00:58,750
So let's implement transitions using open C-v now.
16
00:00:58,760 --> 00:01:00,230
So we're going through line by line.
17
00:01:00,290 --> 00:01:02,580
I'll quickly show you what's being done here.
18
00:01:02,600 --> 00:01:06,940
The important thing to note is that are using to see V2 warp and function.
19
00:01:07,020 --> 00:01:12,920
And that's been implemented down here so quickly going through the image as we've done before we extract
20
00:01:12,920 --> 00:01:17,390
the height and the width of the image using non-pay see function taking only the first two elements
21
00:01:17,540 --> 00:01:21,050
of the ship three that it retains.
22
00:01:21,290 --> 00:01:25,340
Next I have a line here where we extract quarter of the height and width of do it.
23
00:01:25,340 --> 00:01:29,660
That's going to be a T x and y value in our translation Matrix.
24
00:01:29,710 --> 00:01:35,400
That's the direction or sorry the amount of pixels we're going to shift to image.
25
00:01:35,990 --> 00:01:42,140
And we actually use not by fluke to the two that actually defines the read data type for where translations
26
00:01:42,290 --> 00:01:43,680
matrix.
27
00:01:44,060 --> 00:01:48,660
And by using some square brackets here we actually created a T matrix here.
28
00:01:48,770 --> 00:01:53,600
It may or may not be important for you understand this but just take note of the form of this t matrix
29
00:01:53,600 --> 00:01:54,260
here.
30
00:01:54,770 --> 00:01:57,270
So the warp find function takes away image.
31
00:01:57,270 --> 00:02:04,370
So if we look at it in the matrix that we created and all within a height as a table and it actually
32
00:02:04,820 --> 00:02:06,590
returns the translated image.
33
00:02:06,650 --> 00:02:09,230
So let's actually run this and see what it looks like.
34
00:02:11,040 --> 00:02:20,650
Tulla this is a translated image here as you can see it's shifted image of an extraction a quarter of
35
00:02:20,650 --> 00:02:22,840
the initial dimensions.
36
00:02:23,050 --> 00:02:27,740
And similarly for the White image and we're just done with.
37
00:02:27,760 --> 00:02:32,110
So it's important to know that we should just take a look at a T matrix to give give you an understanding
38
00:02:32,110 --> 00:02:33,620
of what we have done here.
39
00:02:34,150 --> 00:02:36,870
So this is exactly what we wanted in 0 2 metrics.
40
00:02:36,890 --> 00:02:44,800
It's 1 0 in disorder anti-X and the way this being a quarter of the height and a quarter of the weight
41
00:02:45,100 --> 00:02:45,720
respectively.
|