1.How to import image and read image?
Create file: The first thing we will do here we are in our project and we are going to click and you can right click anywhere and you can create a new item and we will call this chapter one.
Header files: enter file, so here first of all we are going to include all the header files that we require now throughout this course we will need only three files for opencv. so in one of the chapters we will need one more, but when we go there i will show you how to include that as well only three header files for opencv for opencv, so in one of the chapters we will need one more, but for the rest of them we will need only three files. so we are going to include we are going to write include and then we will write opencv and we will first need our image and then we will write opencv and we will first need our image codex, second need our highgui and imgproc.
we can start off by writing our path now our path will be a string so we can write here string but you can see it doesn't recognize string and the reason is that we have to use the standard library define that this is a string. to avoid these two things what we can do is we can write using name space cv and we can write using namespace std. we are going to define our path. we need create string path to get the image. when we have path, we are going to import our image so we say that Mat going to import our image so we will say that mat image is equals to imread and we will give in the path. this Mat is basically a matric data type that is introduced by opencv to handle all the images, so whenever we are talking about images, we will write the data type as matte. so then we will write imshow to show our image. but it will close automatically because we are not giving it any delay, so we have to add a delay so we can write waitkey, and here we can write 0 for infinity. so this way whenever ir opens up it will not close until we actually press the close butten. so let's run this.