打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Hello World in CSharp

This example requires Emgu CV 1.5.0.0 and up

Hello World - Version 1

We will start by the Hello World sample, written in C#

Emgu CV 3.0

[Expand]

Click to view source code

Emgu CV 1.5

[Expand]

Click to view source code

The above code will create an image of 400x200 with blue background color and the text "Hello, world" in green on the foreground. The image will be displayed a window named "Test Window".

Hello World - Version 2

Showing image using cvNamedWindow is good, but Emgu CV has an event better tool for the same purpose, that is, the ImageViewer class under Emgu.CV.UI namespace.

Emgu CV 3.0

[Collapse]

Click to view source code

using Emgu.CV;using Emgu.CV.CvEnum;using Emgu.CV.Structure;using Emgu.CV.UI;using System.Drawing;...//Create a 3 channel image of 400x200using (Mat img = new Mat(200, 400, DepthType.Cv8U, 3)) {   img.SetTo(new Bgr(255, 0, 0).MCvScalar); // set it to Blue color   //Draw "Hello, world." on the image using the specific font   CvInvoke.PutText(      img,       "Hello, world",       new System.Drawing.Point(10, 80),       FontFace.HersheyComplex,       1.0,       new Bgr(0, 255, 0).MCvScalar);      //Show the image using ImageViewer from Emgu.CV.UI   ImageViewer.Show(img, "Test Window");}

Emgu CV 2.x

[Expand]

Click to view source code 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
VS2010、C#、Emgu CV配置 ; 在C#下使用OpenCV ; C#中使用OpenCV(Emgu CV)
[OpenCV+C#]开发环境的搭建
Emgu CV的配置以及在VS 2012中进行图像处理的步骤和实例
如何零基础学习c语言?
hello world
第四十九讲类模板(1)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服