• 大小: 17.25MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-08-05
  • 语言: C#
  • 标签:

资源简介

1.集成opencv。调用opencvsharp包含所有实例 2.集成打开本地视频、网络摄像头、本地摄像头 3.利用opencv处理图片 4.简单的图片识别 5.直接编译使用

资源截图

代码片段和文件信息

using OpenCvSharp;

namespace OpenCVSharpSample01
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var src = new Mat(new Size(128 128) MatType.CV_8U Scalar.All(255)))
            using (var dst = new Mat())
            {
                for (var y = 0; y < src.Height; y++)
                {
                    for (var x = 0; x < src.Width; x++)
                    {
                        var color = src.Get(y x);
                        var temp = color.Item0;
                        color.Item0 = color.Item2; // B <- R
                        color.Item2 = temp;        // R <- B
                        src.Set(y x color);
                    }
                }

                src.CopyTo(dst);

                using (var window = new Window(“window“ image: dst flags: WindowMode.AutoSize))
                {
                    Cv2.WaitKey();
                }
            }
        }

        /*private static void version2xDeprecated()
        {
            var img = Cv.CreateImage(new CvSize(128 128) BitDepth.U8 1);

            for (var y = 0; y < img.Height; y++)
            {
                for (var x = 0; x < img.Width; x++)
                {
                    Cv.Set2D(img y x x + y);
                }
            }

            Cv.NamedWindow(“window“);
            Cv.ShowImage(“window“ img);
            Cv.WaitKey();
            Cv.DestroyWindow(“window“);

            Cv.ReleaseImage(img);
        }*/
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-04-26 20:59  OpenCVSharp-Samples\
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\.nuget\
     文件         164  2018-08-29 16:36  OpenCVSharp-Samples\.nuget\NuGet.Config
     文件     1664512  2018-08-29 16:36  OpenCVSharp-Samples\.nuget\NuGet.exe
     文件        7484  2018-08-29 16:36  OpenCVSharp-Samples\.nuget\NuGet.targets
     文件       11325  2018-08-29 16:36  OpenCVSharp-Samples\LICENSE.md
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample01\
     文件        6916  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample01\OpenCVSharpSample01.csproj
     文件         152  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample01\packages.config
     文件        1517  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample01\Program.cs
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample01\Properties\
     文件        1414  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample01\Properties\AssemblyInfo.cs
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample02\
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample02\Images\
     文件       69870  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample02\Images\ocv02.jpg
     文件        6988  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample02\OpenCVSharpSample02.csproj
     文件         152  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample02\packages.config
     文件        2057  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample02\Program.cs
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample02\Properties\
     文件        1414  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample02\Properties\AssemblyInfo.cs
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample03\
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample03\Images\
     文件       69870  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample03\Images\ocv02.jpg
     文件        6988  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample03\OpenCVSharpSample03.csproj
     文件         152  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample03\packages.config
     文件        1995  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample03\Program.cs
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample03\Properties\
     文件        1414  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample03\Properties\AssemblyInfo.cs
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample04\
     目录           0  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample04\Images\
     文件       25753  2018-08-29 16:36  OpenCVSharp-Samples\OpenCVSharpSample04\Images\Car.jpg
............此处省略3161个文件信息

评论

共有 条评论

相关资源