不是第一次用OpenCV,但也算第一天开始正式学习OpenCV。此前的学习都是抱着纯实用的态度,半吊子地学,在“抄”代码中学习使用。
今天开始《Learning OpenCV》英文版的正式阅读。
What Is OpenCV?Who Uses OpenCV?What Is Computer Vision?这一章节老老实实地看完了,不得不说还是加深了不少理解。监控,无人飞船,游戏接口,生物医学,应用颇广。
OpenCV Structure and Content这一部分清楚地讲清了几个lib:
CV component :contains the basic image processing and higher-level computer vision algorithms;
图像处理与高级计算机视觉算法
ML is the machine learning library, which includes many statistical classifiers and clustering tools.
机器学习,包含很多统计分类器和聚类工具
HighGUI contains I/O routines and functions for storing and loading video and images.
输入输出,存储与加载视频与影像
CvAux is not particularly well documented in the Wiki and is not documented at all in
the .../opencv/docs subdirectory.
比较奇葩,有部分在CV中,也有部分不在。它在otherlibs文件夹下也正说明其奇葩吧。
CXCore contains the basic data structures and content.
基本数据结构和内容
最后,简单程序附一个,程序简单,还是废了我这小白一番功夫调试正确
#include "highgui.h"
void main() {
IplImage* img = cvLoadImage( "1.jpg", CV_LOAD_IMAGE_COLOR);
cvNamedWindow( "Example1", 0 );
cvShowImage( "Example1", img );
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( "Example1" );
}
说明:
(1)百度百科解释cvLoadImage
to 0 (the default value) or to CV_WINDOW_AUTOSIZE. In the former case, the size of the
window will be the same regardless of the image size, and the image will be scaled to
fi t within the window. In the latter case, the window will expand or contract automatically
when an image is loaded so as to accommodate the image’s true size.
如果想正常显示,对于大图神马的还是参数用0(默认值)吧,否则可能看到的只是图像一小部分,window只展现很小的一部分哦~