值方图(Histogram)是一种统计图数据,在影像处理中最常被用来统计一张图像或是感兴趣(ROI)区域的色彩分布,在这边本人使用的EmguCV 2.4.0版的内建值方图工具只有被包含在WinForm应用程序中至于要如何在WPF绘制值方图,那就要花比较多的步骤了,我们得自己画,这部分后续文章会在介绍

 
所以接下来介绍的绘制环境是在C#的WinForm项目,
 
步骤
 
1.加入HistogramBox组件到WinForm
 
点选上排工具 –> 选择工具箱 –> .Net Framework 组件中点选选择,找到EmguCV项目下的Emgu.CV.UI.dll并把dll加入后再次看一下.Net Framework 组件便会发现:
 

 
2.在Form的设计工具箱中便会找到HistogramBox
 
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.CV.UI; namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} /*
* 第一对
* HistogramBox The control that is used to display histogram(需要事先设计位置)
* HistogramViewer A view for histogram(弹出新窗口,不需要事先设计)
* 第二对
* ImageBox An image box is a user control that is similar to picture box, but display Emgu CV IImage and provides enhenced functionalities.
* ImageViewer The Image viewer that display IImage
* 第三对
* MatrixBox A control that is used to visualize a matrix(用户控件)
* MatrixViewer A MatrixViewer that is used to visualize a matrix(弹出窗口)
*
* 第四个
* Operation An operation contains the MethodInfo and the methods parameters. It provides a way to invoke a specific method with the specific parameters.
* PanAndZoomPictureBox A picture box with pan and zoom functionality (可以事先图像的缩放)
*/
private void Form1_Load(object sender, EventArgs e)
{
Image<Bgr, byte> img = new Image<Bgr, byte>(@"C:\a2.jpg"); //Emgu.CV.UI.ImageBox 需要在窗口中设计
this.imageBox1.Image = img;
this.matrixBox1.Matrix = img;
this.panAndZoomPictureBox1.Image = Image.FromFile(@"C:\a1.jpg"); //The Imageviewer 直接弹出新的窗口
Image<Bgr, byte> loadImg = new Image<Bgr, byte>(@"C:\a1.jpg");
ImageViewer viewer = new ImageViewer(loadImg, "Loaded Image");
viewer.Show(this); //1.使用HistogramViewer不需要事先拉到设计窗口中,他是弹出窗口,你只需要直接使用便可以
HistogramViewer.Show(loadImg[], ); //image[0] 显示Blue,bin = 32
HistogramViewer.Show(loadImg, ); //显示所有信道 //2.使用HistogramBox,需要事先拉窗口中设定在窗口画面
this.histogramBox1.GenerateHistograms(loadImg, );
this.histogramBox1.Refresh(); //如果不刷新,图像显示一部分,没有自动缩放的功能
//this.histogramBox1.Show(); //如果不是刷新图像,有没有都可以
}
}
}
 

EmguCV3.0几个控件的使用的更多相关文章

  1. 与众不同 windows phone (34) - 8.0 新的控件: LongListSelector

    [源码下载] 与众不同 windows phone (34) - 8.0 新的控件: LongListSelector 作者:webabcd 介绍与众不同 windows phone 8.0 之 新的 ...

  2. UiAutomator2.0 - 获取同行控件

    目录 问题:UI测试时,在同一个界面出现相同的属性的控件(如图),对于这种控件的获取很是无奈.如果直接通过控件id去查找的话总是会返回界面该类型的第一个控件. 解决: 1.UiObject2 中已经给 ...

  3. VB6.0中WinSock控件属性和方法详解

    原文链接:http://liweibird.blog.51cto.com/631764/653134 WinSock控件能够通过UDP协议(用户数据报协议)或TCP协议(数据传输协议)连接到远程的机器 ...

  4. CefSharp.v49.0.1浏览器控件完全WPF版,实现禁止弹出新窗口,在同一窗口打开链接,并且支持带type="POST" target="_blank"的链接

    需求场景:在查询页面,填写查询条件,查询条件包括上传的图片,根据图片的特征查询,这就需要在提交的时候,使用POST提交,因为GET提交无法提交图片数据,提交查询条件之后,在新的窗口展示查询结果.(当然 ...

  5. Vue.2.0.5-表单控件绑定

    基础用法 你可以用 v-model 指令在表单控件元素上创建双向数据绑定.它会根据控件类型自动选取正确的方法来更新元素.尽管有些神奇,但 v-model 本质上不过是语法糖,它负责监听用户的输入事件以 ...

  6. andorid 控件 Bootstrap3.0风格的控件 精美UI控件库

    Bootstrap是Twitter推出的一个开源的用于前端开发的工具包.它由Twitter的设计师Mark Otto和Jacob Thornton合作开发,是一个CSS/HTML框架.Bootstra ...

  7. 解决Win7下VC6.0插入ActiveX控件对话框为空的问题

    在Win7环境下,编写MFC应用程序,Project菜单下Add To Project子菜单中的 Components and Controls…选项,在弹出的对话框中Gallery文件为空,也就无法 ...

  8. FineUI(专业版)v3.2.0 发布(ASP.NET UI控件库)!

    +2016-08-20 v3.2.0 +表格增强. +表格列RenderField增加属性ClientHtmlEncode,用于在客户端进行HTML编码. -增加示例:单元格编辑->杂项-> ...

  9. Android5.0新控件CardView的介绍和使用

       CardView也是5.0的新控件,这控件其实就是一个卡片啦,当然我们自己也完全可以定义这样一个卡片,从现在的微博等社App中可以看到各式各样的自定义卡片,所以这个控件意义不是很大.suppor ...

随机推荐

  1. Lightoj 1370 素数打表 +二分

    1370 - Bi-shoe and Phi-shoe   PDF (English) Statistics   Time Limit: 2 second(s) Memory Limit: 32 MB ...

  2. python matrix/array反向切片

    >>> import numpy as np >>> m = np.mat([[1.,1,1],[1,2,3,],[1,5,1,]]) >>> m ...

  3. 自己动手实现一个简化版的requireJs

    一直想实现一个简单版本的requireJs,最直接的办法去看requireJs源码搞明白原理,但是能力有限requireJs的源码比想象的要复杂许多,看了几遍也不是很明白,最后通过搜索找到了一些有价值 ...

  4. jsp用tags传递参数

    <computer:trangleTag sideA="12" sideB="12" sideC="12"/>表示以字符串传递s ...

  5. 在express中提供静态文件笔记

    在express中提供静态文件 要在express框架中提供静态文件,如:css.javascript等文件,就要使用到他的内置中间件功能express.static,将包含静态文件目录文件传递给ex ...

  6. 51nod 1202 线性dp

    http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1202 1202 子序列个数 题目来源: 福州大学 OJ 基准时间限制:1 ...

  7. lr中检查点的使用web_find()和web_reg_find()的区别

    web_find()和web_reg_find()的区别:1. 这两个函数函数类型不同,web_find()是普通函数,web_reg_find()是注册函数;2. VU run time设置中的 “ ...

  8. ionic3 教程(一)安装和配置

    // 安装(失败的话 Mac 尝试使用 sudo,Windows 尝试管理员身份运行 cmd) $ npm install -g cordova ionic // 安装后可以验证一下 ionic cl ...

  9. AOP注解式拦截

    1. 自己定义的拦截注解 package com.spring.aop; import java.lang.annotation.Documented; import java.lang.annota ...

  10. 使用手势对UIImageView进行缩放、旋转和移动(转)

    原文地址:http://blog.csdn.net/crazy_frog/article/details/8664108 // 添加所有的手势 - (void) addGestureRecognize ...