I am not good at the English.But I will use English to record the process of learn Computer Vision(CV).Today is the fisrt time to record the test,so let us to pratice a simple demo about how to read a Image and show it.it's the base about CV.it's very easy.
Firstly,I am going to introduce a library about CV.it's OpenCV.it's a open source library.it can help us to read and process the Image and video.I am not going to introduce the configure about OpenCV in the Microsoft Visual Studio.you can search these by Baidu or Google.they will provide many ways to help you solve the problem.
Secondly,let us to see the Code:
#include"iostream"
#include"opencv2/opencv.hpp"
using namespace std;
using namespace cv;
int main(int argc, char* argv)
{
Mat src = imread("7258\\m1.png");
imshow("src", src);
waitKey(0);
return 0;
}
Look!it's short and simple.But it's too hard for the rookie.In fact ,I am a rookie , too.
#include"iostream"
#include"opencv2/opencv.hpp"
#include is used to load the head file.if you lerned the C++ ,you must be know the effect.if you have never learn about the computer language,I think that you'd better learn it spend a lot time.it's important for your future.
using namespace std;
using namespace cv;
this two lines will help us cut the long code.If we don't use these we should write cv::imread() to read a image.
int main(int argc, char* argv)
{
Mat src = imread("7258\\m1.png");
imshow("src", src);
waitKey(0);
return 0;
}
this is the main function.we can see the four lines in the main function.this is the key message today.imread() will read an Image and return a Mat Object.In the OpenCV of the C++,we are often use the Mat Object.imshow(name string,Mat Object) will show the Image ,then we will see the picture on the screen.waitKey(0) help us keep the picture on the screen all the time untill you push the Enter or else Key.if we are not use the waitKey(0),you will see the picture,then disappear right away.if you have learned the C++, I belive that you are not ask the question.
Last but not least,I am not a tutor and this article is not a tutorials.I just to record the process,and let others can learn some thing from my experience.