bonjour,
j'ai écrit un petit code qui affiche une image sur le pictureBox en utilisant Emgu.CV.
j'ai ajouté toutes les dll de opencv nécessaires mais un message d'erreur
une exception à été levée par l'initialiseur de type pour 'emgu.cv.CvInvoKe'
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 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;
namespace filtre
{public partial class Form1 : Form
    {public Form1()
        {InitializeComponent();}
        private void button1_Click(object sender, EventArgs e)
        {OpenFileDialog openfile = new OpenFileDialog();
        if (openfile.ShowDialog() == DialogResult.OK)
        {   Image<Bgr, Byte> img = new Image<Bgr, Byte>(openfile.FileName);//uploader l'image
            Image<Gray, Byte> gray = img.Convert<Gray, Byte>().PyrDown().PyrUp();//conversion en niveau 
            //de gris et echantillonage
            Gray cannyThreshold = new Gray(180);//définir le seuil
            Gray cannyThresholdLinking = new Gray(120);//définir le seuil
            Image<Gray, Byte> cannyEdges = gray.Canny(cannyThreshold, cannyThresholdLinking);//filtre de
            //canny
 
            pictureBox1.Image = cannyEdges.ToBitmap();
        }}
        private void pictureBox1_Click(object sender, EventArgs e)
        {
        }}}
merci