OpenCV 2.1.0 with Visual Studio 2010(1)

如果Debug下不能运行,则切换到Release版本下!!!(以前网上查到,不明真相)

实践中可用的方案1:

http://blog.aguskurniawan.net/post/OpenCV-210-with-Visual-Studio-2010.aspx


OpenCV 2.1.0 with Visual Studio 2010

By Agus Kurniawan23. 六月 2010 00:24

OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. Two months ago OpenCV released the new version of OpenCV 2.1. On this article, I would like to share how to use OpenCV with Visual Studio 2010.

System Requirements

  • Download OpenCV 2.1 or the latest, [V]
  • Download Visual Studio 2010, you can download an express edition [V]

I use Windows 7 x64 as development environment.

OpenCV 2.1 Installation

After you downloaded OpenCV library. Click setup file and then you’ll get a dialog as below

inst1

Click Next button

inst2

Click I Agree button

inst3

Choose Do not add OpenCV to the system PATH (you may choose any option) and then click Next button

inst4

Choose Destnation Folder that you want to store OpenCV files. After that, click Next button

inst5

Click Next button

inst6

Select the type of install Full. After that click Install button. Installer will install OpenCV library on your system.

inst7

Click Finish button to finish installation process.

Now you can see OpenCV 2.1 on your system. You can check on folder where OpenCV installed

openCV

Visual Studio 2010 Project Configuration

After you created a C/C++ project on Visual Studio 2010 you should configure OpenCV on Visual Studio 2010. Open properties dialog of project. Assume your OpenCV 2.1 installed on C:/OpenCV2.1

On properties dialog, click C/C++ –>General and entry C:/OpenCV2.1/include/opencv in Additional Include Directories

conf1

On properties dialog, click C/C++ –>Advanced and select Compile As. If you prefer C compiler, use Compile as C Code (/TC) 

conf2

On properties dialog, click Linker –>General and entry C:/OpenCV2.1/lib in Additional Library Directories

conf3

On properties dialog, click Linker –>Input and entry all *.lib files in Additional Dependencies. If you’re running on debug mode, try to entry all *d.lib files

 conf4

conf5

After you do all tasks above, click OK button on Propeties dialog.

Testing

For testing purpose, try to write this code (*note* change image file c:/temp/monas.jpg)

#include <stdio.h>
#include <highgui.h>
int main( int argc, char** argv ) 
{	
	IplImage* img = cvLoadImage( "c:/temp/monas.jpg",1 );
	cvNamedWindow("Monas", CV_WINDOW_AUTOSIZE );
	cvShowImage("Monas", img );
	cvWaitKey(0);
	cvReleaseImage( &img );
	cvDestroyWindow("Monas");
} 

Compile and run it. If success, you get image viewer dialog as below

monas

when you run this code from Visual Studio  and get error as below. Try to copy *.dll from OpenCV (C:/OpenCV2.1/bin) on folder where your executable file was located

error

 

Donate this article:   

当前评分 4.8 , 共有 4 人参与

 

内容概要:本文详细介绍了基于FPGA的144输出通道可切换电压源系统的设计与实现,涵盖系统总体架构、FPGA硬件设计、上位机软件设计以及系统集成方案。系统由上位机控制软件(PC端)、FPGA控制核心和高压输出模块(144通道)三部分组成。FPGA硬件设计部分详细描述了Verilog代码实现,包括PWM生成模块、UART通信模块和温度监控模块。硬件设计说明中提及了FPGA选型、PWM生成方式、通信接口、高压输出模块和保护电路的设计要点。上位机软件采用Python编写,实现了设备连接、命令发送、序列控制等功能,并提供了一个图形用户界面(GUI)用于方便的操作和配置。 适合人群:具备一定硬件设计和编程基础的电子工程师、FPGA开发者及科研人员。 使用场景及目标:①适用于需要精确控制多通道电压输出的实验环境或工业应用场景;②帮助用户理解和掌握FPGA在复杂控制系统中的应用,包括PWM控制、UART通信及多通道信号处理;③为研究人员提供一个可扩展的平台,用于测试和验证不同的电压源控制算法和策略。 阅读建议:由于涉及硬件和软件两方面的内容,建议读者先熟悉FPGA基础知识和Verilog语言,同时具备一定的Python编程经验。在阅读过程中,应结合硬件电路图和代码注释,逐步理解系统的各个组成部分及其相互关系。此外,实际动手搭建和调试该系统将有助于加深对整个设计的理解。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值