Comments (4)
我不知道你是不是用的VS
如果你是用的VS的话,那就在项目配置的linker选项上添加opencv_world330.lib(我的是opencv3.3,加d的那个是调试版本的,其他版本的opencv也是一样)比如\opencv\build\x64\vc14\lib这个路径(你用Cmake编的lib可能在其他地方)
然后在linker下面的那个input选项的Additional Dependencies加上opencv_world330.lib
实测不加上就会出现和你一样的报错情况,加了就好了
from opencv3-intro-book-src.
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace cv;
using namespace std;
int main()
{
// 初始化变量和随机值
Mat image(600, 600, CV_8UC3);
RNG& rng = theRNG();
// 循环,按下ESC, Q, q键程序退出,否则有键按下便一直更新
while (1)
{
// 参数初始化
int count = rng.uniform(3, 103); // 随机生成点的数量
vector<Point> points; // 点值
// 随机生成点坐标
for (int i = 0; i < count; i++)
{
Point point;
point.x = rng.uniform(image.cols/4, image.cols*3/4);
point.y = rng.uniform(image.rows/4, image.rows*3/4);
points.push_back(point);
}
// 对给定的2D点集,寻找最小面积的包围矩形
RotatedRect box = minAreaRect(Mat(points));
Point2f vertex[4];
box.points(vertex);
// 绘制出随机颜色的点
image = Scalar::all(0);
for( int i = 0; i < count; i++ )
circle( image, points[i], 3, Scalar(rng.uniform(0, 255), rng.uniform(0, 255), rng.uniform(0, 255)), CV_FILLED, CV_AA );
// 绘制出最小面积的包围矩形
for( int i = 0; i < 4; i++ )
line(image, vertex[i], vertex[(i+1)%4], Scalar(100, 200, 211), 2, CV_AA);
// 显示窗口
imshow( "矩形包围示例", image );
// 按下ESC, Q, 或者q,程序退出
char key = (char)waitKey();
if (key == 27 || key == 'q' || key == 'Q') // 'ESC'
break;
}
return 0;
}
from opencv3-intro-book-src.
你没有链接静态库吧
from opencv3-intro-book-src.
Hi,请问如何“链接静态库”?有示例的命令吗?
from opencv3-intro-book-src.
Related Issues (19)
- opencv3.0 支持alpha 合成图片么?
- 实在忍不住了,勘误的啥!!! HOT 1
- Canny函数的使用
- OpenCV3.4.2下使用VS2017运行3.1.9图像混合程序崩溃报错? HOT 1
- 关于原书7.2.3霍夫线性变换的原理 p269页勘误一处 HOT 1
- 大神走好, R.I.P. HOT 6
- 逝者安息-- 钟小白Core
- 逝者安息 知识永存
- 大神走好 逝者安息
- 英雄走好!
- 感谢浅墨老师!
- 本书是否还会继续扩充? HOT 1
- RIP
- 大神一路走好,愿来生面朝大海,春暖花开
- R.I.P , 虽未蒙面,但从老师身上受益良浅,老师一路走好 HOT 1
- 9.2.4绘制一维直方图
- OpenCV3示例代码的第16个程序:imageROI= image(Rect(800,350,logo.cols,logo.rows));出错 HOT 1
- vs2010中文乱码 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencv3-intro-book-src.