This document provides an introduction to OpenCV and computer vision. It discusses what computer vision is, some applications of computer vision, the history and modules of OpenCV, basic image structures and I/O functions in OpenCV, and how to compile and configure OpenCV projects.
6. “Computer vision is the science of endowing computers or
other machines with vision, or the ability to see.”
- Erik G. Learned-Miller, University of Massachusetts
15. Image I/O
●
Imread
→ read image from file
Mat imread(const string& filename, int flags=1 )
●
Imwrite
→ save image to a file
bool imwrite(const string& filename, InputArray img, const vector<int>& params=vector<int>() )
●
ImShow
→ show the image in a windows
Void imshow(const string& winame, InputArray mat)
16. Basic draw functions
●
Circle
→ void circle(Mat& img, Point center, int radius, const Scalar& color, int thickness=1, int
lineType=8, int
●
Line
→ void line(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int
lineType=8, int shift=0)
●
Ellipse
→ void ellipse(Mat& img, Point center, Size axes, double angle, double startAngle, double
endAngle, const Scalar& color, int thickness=1, int lineType=8, int shift=0)