emgucv中mat的含义是什么? [英] What is meaning of mat in emgucv?

查看:236
本文介绍了emgucv中mat的含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过使用emgucv库来显示图片的直方图,但我对Mat指令有问题,程序给出了一条消息Mat没有找到......如何解决?我可以用什么代替呢?



我尝试过的事情:



使用Emgu.CV; 
使用Emgu.CV.Structure;

命名空间直方图
{
公共部分类Form1:表格
{
图像< Bgr,字节> IMGB;
图像<灰色,字节> imgG;
public Form1()
{
InitializeComponent();
}
< pre> private void button1_Click(object sender,EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
if(ofd.ShowDialog()== DialogResult.OK)
{
imgB = new Image< Bgr,byte>(ofd .FileName);
imageBox1.Image = imgB;
imageBox1.FunctionalMode = Emgu.CV.UI.ImageBox.FunctionalModeOption.Minimum;
}
}

private void button2_Click(object sender,EventArgs e)
{
imgG = imgB.Convert< Gray,byte>();
panAndZoomPictureBox1.Image = imgG.Bitmap;
}

private void button3_Click(object sender,EventArgs e)
{
DenseHistogram hist = new DenseHistogram(256,new RangeF(0,255));
hist.Calculate(new Image< Gray,byte> [] {imgB [0]},false,null);
Mat m = new Mat();
hist.Copy(m);

histogramBox1.AddHistogram(Blue,Color.Blue,m);
}
}

解决方案

这可能对你有用



Mat Class [ ^ ]


文档 - Emgu简历: .NET中的OpenCV(C#,VB,C ++等) [ ^ ]

I want to display a histogram of the picture by using emgucv library but I have a problem with the instruction "Mat", the program gives a message that the 'Mat' do not found...how solve that? and by what I can replace it?

What I have tried:

using Emgu.CV;
using Emgu.CV.Structure;

namespace histogram
{
    public partial class Form1 : Form
    {
        Image<Bgr, byte> imgB;
        Image<Gray, byte> imgG;
        public Form1()
        {
            InitializeComponent();
        }
<pre>private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            if(ofd.ShowDialog()==DialogResult.OK)
            {
                imgB = new Image<Bgr, byte>(ofd .FileName );
                imageBox1.Image = imgB;
                imageBox1.FunctionalMode = Emgu.CV.UI.ImageBox.FunctionalModeOption.Minimum;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            imgG = imgB.Convert<Gray, byte>();
            panAndZoomPictureBox1.Image = imgG.Bitmap;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            DenseHistogram hist = new DenseHistogram(256, new RangeF(0, 255));
            hist.Calculate(new Image<Gray, byte>[] {imgB[0] }, false, null);
            Mat m = new Mat();
            hist.Copy(m);

            histogramBox1.AddHistogram("Blue", Color.Blue, m);
        }
    }

解决方案

This may be useful for you

Mat Class[^]


Documentation - Emgu CV: OpenCV in .NET (C#, VB, C++ and more)[^]


这篇关于emgucv中mat的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆