Welcome to Lesson one of the section going forward we'll be using a text editor whether it's Adam sublime
whatever you choose to work with it if you still don't have a text editor installed.
Make sure to refer back to the text editor installation tutorial in section 2 before proceeding any
further.
The purpose of this section is to build a program that can identify lane lines in a picture or a video.
When you and I drive a car we can see where the lane lines are using our ice.
A car doesn't have any ice and that's where a computer vision comes in.
Which through complex algorithms helps the computer see the world as we do.
In our case we'll be using it to see the road and identify lane lines in a series of camera images.
This lesson in particular will be quite simple as all we're going to do is set up the initial stages
of our project and display an image onto which we'll be identifying lane lines.
You'll start by opening up your terminal or command prompt and navigate to the desktop directory with
the command CD desktop changed directory desktop inside of desktop will make a new folder with the command
M-K Diyar make directory finding Laine's this folder you just made inside of desktop.
You're going to open up without them by going to file open desktop find new layouts instead of finding
Layne's make a new python file called Elayne's.
Doc Putois inside of the Layne's file We're going to start by writing a program that can identify lines
in a jpeg image.
I posted the image on my get hub Taxus that.
Sure to go to the following link and so once you get to this page click on test image Doug j peg and
we're going to do is actually download the image.
Or better yet just save the image and make sure to save it as a cheap image.
It doesn't matter where you save it and make sure this says test image such that there are no extra
ones or Couzin there so that your naming remains consistent with what I have in the videos.
Right.
Save your image.
Once you download it wherever you have it downloaded make sure to drag it into your project folder like
so.
And now to display the image we're going to use open VI an open source computer vision library.
So inside of your terminal we're going to write the command Pipp install will make use of the package
manager Pepp to install open C-v contrib dush Python
once you're finished installing it back to Visual Studio we're going to import the library CV to and
from the library for now we will access two functions read and show to load our image.
We'll first make use of the read function by setting image is equal to see me to read.
And in this argument is where you will specify the image the file name as a string.
Is is test image jpeg.
And what this function will do is read the image from our file and return it as a multi-dimensional
PI array containing the relative intensities of each pixel in the image.
We now have our image data and an umpire right.
The next step is to actually render it with the M show function.
So we're right CB2 in show this takes two arguments the first one is the name of the one that we're
going to open up we'll just call that result.
And the second argument is the image that we want to show itself.
If I run the code now to my terminal navigate to my project folder by reading CD Our project is named
finding lanes and run the python file Python Elayne's dot p y.
Notice that nothing is going to happen.
That's because this function should be followed by the weight key function CB2 weight key.
And what this function does is it displays the image for a specified amount of milliseconds.
We'll set a time of zero.
What this will do is it will display our window result to window infinitely until we press anything
in our keyboard.
If we rerun the code Python Laine's the image is displayed and notice our window name.
Results will keep this lesson short and stop here.
You learn how to load and display images using the open CB library and the next lesson we'll start discussing
canny edge detection a technique that will use to write a program that can detect edges in an image
and thereby single out the lane lights.