﻿1
00:00:00,210 --> 00:00:05,730
Welcome to Lesson one of the section going forward we'll be using a text editor whether it's Adam sublime

2
00:00:05,730 --> 00:00:09,420
whatever you choose to work with it if you still don't have a text editor installed.

3
00:00:09,420 --> 00:00:15,090
Make sure to refer back to the text editor installation tutorial in section 2 before proceeding any

4
00:00:15,090 --> 00:00:16,020
further.

5
00:00:16,020 --> 00:00:21,890
The purpose of this section is to build a program that can identify lane lines in a picture or a video.

6
00:00:21,990 --> 00:00:26,930
When you and I drive a car we can see where the lane lines are using our ice.

7
00:00:27,000 --> 00:00:30,920
A car doesn't have any ice and that's where a computer vision comes in.

8
00:00:31,020 --> 00:00:35,670
Which through complex algorithms helps the computer see the world as we do.

9
00:00:35,880 --> 00:00:41,750
In our case we'll be using it to see the road and identify lane lines in a series of camera images.

10
00:00:41,760 --> 00:00:46,500
This lesson in particular will be quite simple as all we're going to do is set up the initial stages

11
00:00:46,500 --> 00:00:52,500
of our project and display an image onto which we'll be identifying lane lines.

12
00:00:52,500 --> 00:00:58,080
You'll start by opening up your terminal or command prompt and navigate to the desktop directory with

13
00:00:58,080 --> 00:01:06,270
the command CD desktop changed directory desktop inside of desktop will make a new folder with the command

14
00:01:06,300 --> 00:01:14,970
M-K Diyar make directory finding Laine's this folder you just made inside of desktop.

15
00:01:14,970 --> 00:01:24,640
You're going to open up without them by going to file open desktop find new layouts instead of finding

16
00:01:24,640 --> 00:01:28,280
Layne's make a new python file called Elayne's.

17
00:01:28,300 --> 00:01:35,400
Doc Putois inside of the Layne's file We're going to start by writing a program that can identify lines

18
00:01:35,400 --> 00:01:37,320
in a jpeg image.

19
00:01:37,320 --> 00:01:40,080
I posted the image on my get hub Taxus that.

20
00:01:40,170 --> 00:01:48,850
Sure to go to the following link and so once you get to this page click on test image Doug j peg and

21
00:01:48,940 --> 00:01:51,740
we're going to do is actually download the image.

22
00:01:51,760 --> 00:01:57,930
Or better yet just save the image and make sure to save it as a cheap image.

23
00:01:57,930 --> 00:02:03,580
It doesn't matter where you save it and make sure this says test image such that there are no extra

24
00:02:03,580 --> 00:02:09,510
ones or Couzin there so that your naming remains consistent with what I have in the videos.

25
00:02:09,720 --> 00:02:10,180
Right.

26
00:02:10,180 --> 00:02:11,860
Save your image.

27
00:02:12,310 --> 00:02:17,470
Once you download it wherever you have it downloaded make sure to drag it into your project folder like

28
00:02:17,470 --> 00:02:18,170
so.

29
00:02:18,510 --> 00:02:24,940
And now to display the image we're going to use open VI an open source computer vision library.

30
00:02:24,940 --> 00:02:33,370
So inside of your terminal we're going to write the command Pipp install will make use of the package

31
00:02:33,370 --> 00:02:39,100
manager Pepp to install open C-v contrib dush Python

32
00:02:45,930 --> 00:02:53,130
once you're finished installing it back to Visual Studio we're going to import the library CV to and

33
00:02:53,130 --> 00:02:59,920
from the library for now we will access two functions read and show to load our image.

34
00:02:59,940 --> 00:03:07,450
We'll first make use of the read function by setting image is equal to see me to read.

35
00:03:07,880 --> 00:03:13,080
And in this argument is where you will specify the image the file name as a string.

36
00:03:13,440 --> 00:03:19,060
Is is test image jpeg.

37
00:03:19,860 --> 00:03:25,470
And what this function will do is read the image from our file and return it as a multi-dimensional

38
00:03:25,640 --> 00:03:30,740
PI array containing the relative intensities of each pixel in the image.

39
00:03:30,780 --> 00:03:33,470
We now have our image data and an umpire right.

40
00:03:33,480 --> 00:03:37,110
The next step is to actually render it with the M show function.

41
00:03:37,170 --> 00:03:46,100
So we're right CB2 in show this takes two arguments the first one is the name of the one that we're

42
00:03:46,100 --> 00:03:48,920
going to open up we'll just call that result.

43
00:03:49,100 --> 00:03:52,720
And the second argument is the image that we want to show itself.

44
00:03:54,230 --> 00:04:01,430
If I run the code now to my terminal navigate to my project folder by reading CD Our project is named

45
00:04:01,490 --> 00:04:07,890
finding lanes and run the python file Python Elayne's dot p y.

46
00:04:08,390 --> 00:04:11,440
Notice that nothing is going to happen.

47
00:04:11,690 --> 00:04:18,730
That's because this function should be followed by the weight key function CB2 weight key.

48
00:04:19,190 --> 00:04:24,620
And what this function does is it displays the image for a specified amount of milliseconds.

49
00:04:24,620 --> 00:04:26,660
We'll set a time of zero.

50
00:04:26,690 --> 00:04:33,070
What this will do is it will display our window result to window infinitely until we press anything

51
00:04:33,080 --> 00:04:34,330
in our keyboard.

52
00:04:34,670 --> 00:04:41,780
If we rerun the code Python Laine's the image is displayed and notice our window name.

53
00:04:41,840 --> 00:04:44,740
Results will keep this lesson short and stop here.

54
00:04:44,750 --> 00:04:50,450
You learn how to load and display images using the open CB library and the next lesson we'll start discussing

55
00:04:50,450 --> 00:04:56,870
canny edge detection a technique that will use to write a program that can detect edges in an image

56
00:04:57,290 --> 00:04:59,450
and thereby single out the lane lights.


