首页 > 其他分享 >WPF OpenCVSharp4

WPF OpenCVSharp4

时间:2024-05-21 20:40:29浏览次数:25  
标签:Windows System OpenCVSharp4 Window OpenCvSharp new using WPF

using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using OpenCvSharp;
using OpenCvSharp.Internal.Vectors;

namespace WpfApp106
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : System.Windows.Window
    {
        public MainWindow()
        {
            InitializeComponent();
            OpenCVSharpDemo(); 
        }

        void OpenCVSharpDemo()
        {
            string url = @"D:\\C\\WpfApp106\\cl2.jpg";
            var src = new Mat(url, ImreadModes.Unchanged);
            var dst = new Mat();
            Cv2.Canny(src, dst, 50, 200);
            using (new OpenCvSharp.Window("Src Image", src))
            using (new OpenCvSharp.Window("Dst Image", dst))
            {
                Cv2.WaitKey();
            } 
        }
    }
}

 

标签:Windows,System,OpenCVSharp4,Window,OpenCvSharp,new,using,WPF
From: https://www.cnblogs.com/Fred1987/p/18204888

相关文章

  • WPF Image ZoomIn ZoomOut via MouseWheel
    //xaml<Windowx:Class="WpfApp104.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.mi......
  • WPF使用静态属性制作按钮样式
    <Window.Resources><!--定义样式--><Stylex:Key="CustomButtonStyle"TargetType="Button"><SetterProperty="Tag"Value="{x:Staticlocal:ButtonColorSets.Button1Colors}"/>......
  • WPF mvvm find element by name
    Copyfrom https://stackoverflow.com/questions/636383/how-can-i-find-wpf-controls-by-name-or-type //xaml<Windowx:Class="WpfApp102.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmln......
  • 【C#】WPF字典资源设置Button控件样式
    <ResourceDictionaryxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"><Stylex:Key="BtnInfoStyle"TargetType="Button">......
  • 自研WPF插件系统(沙箱运行及热插拔)
    前言插件化的需求主要源于对软件架构灵活性的追求,特别是在开发大型、复杂或需要不断更新的软件系统时,插件化可以提高软件系统的可扩展性、可定制性、隔离性、安全性、可维护性、模块化、易于升级和更新以及支持第三方开发等方面的能力,从而满足不断变化的业务需求和技术挑战。一......
  • 01_WPF+Prism登录之PasswordBox的Binding
    #region登录信息///<summary>///密码///</summary>privatestring_Pwd;///<summary>///密码///</summary>publicstringPwd{get{return_Pwd;}......
  • WPF ListBox acts image container, ItemTemplate,DataTemplate,
    <Windowx:Class="WpfApp100.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft......
  • 不一样的WPF多语言切换方案
    前言作为技术而言,我并不认为多语言有什么值得深入研究的地方,本来也没打算开这个话题。前段时间看到了群里有朋友在讨论这个,一想到它确实也算一个比较常用的功能,所以决定对它做一个封装,如果您正好需要,希望对您有帮助。多语言切换一般有两种方案,一种是使用资源字典(xaml文......
  • WPF Color ColorConverter.ConvertFromString convert hex to readable color
    stringcolorStr="#FF00008B";ColorbrushColor=(Color)ColorConverter.ConvertFromString(colorStr);  usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows;us......
  • 界面组件DevExpress WPF中文教程 - 如何从CRTX模板文件导入图表设置
    DevExpressWPF 拥有120+个控件和库,将帮助您交付满足甚至超出企业需求的高性能业务应用程序。通过DevExpressWPF能创建有着强大互动功能的XAML基础应用程序,这些应用程序专注于当代客户的需求和构建未来新一代支持触摸的解决方案。无论是Office办公软件的衍伸产品,还是以数据为中......