opencvsharp

用OpenCVSharp来生成棋盘格图片

◇◆丶佛笑我妖孽 提交于 2021-01-30 09:03:29
我发现,有很多人都在研究相机的标定,里面会经常用到棋盘,这里我们就用OpencvSharp来自己做一个棋盘函数。 直接上代码。 1 /// <summary> 2 /// 用于生成标准棋盘格的函数 3 /// </summary> 4 /// <param name="imgw"></param> 5 /// <param name="imgh"></param> 6 /// <param name="chesss_size"></param> 单个棋盘格子的大小 7 /// <param name="board_width"></param> 棋盘的宽的格子数量 8 /// <param name="board_height"></param> 棋盘的高的格子数量 9 /// <param name="savepath"></param> 10 /// <param name="imgformat"></param> 代表图片格式,枚举型 11 public static void GenChessBoard( int imgw, int imgh, int chesss_size, int board_width_count, int board_height_count, string savename, Imgformat imgformat= Imgformat.Jpg)

opencvsharp打开相机并视频显示

蓝咒 提交于 2021-01-27 22:29:32
参考: https://www.coder.work/article/2085334 内容:在winform和opencvsharp的环境下,利用一个button事件控制相机(打开和关闭),并将相机获取的图片显示在picturebox中。 private void 打开相机_Click(object sender, EventArgs e) { try { if (打开相机.Text.Equals("打开相机")) { CaptureCamera(); 打开相机.Text = "关闭相机"; isCameraRunning = 1; } else { capture.Release(); 打开相机.Text = "打开相机"; isCameraRunning = 0; } } catch (NullReferenceException exception) { MessageBox.Show(exception.Message); } } private void CaptureCamera() { camera = new Thread(new ThreadStart(CaptureCameraCallback)); camera.Start(); } private void CaptureCameraCallback() { frame = new Mat();

Git异常The remote end hung up unexpectedly解决方案

限于喜欢 提交于 2020-11-19 20:27:48
场景 $ git clone https://github.com/shimat/opencvsharp.git Cloning into 'opencvsharp'... remote: Enumerating objects: 135, done. remote: Counting objects: 100% (135/135), done. remote: Compressing objects: 100% (90/90), done. error: RPC failed; curl 56 SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054 fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed 解决方案 公司网络慢因此设置git配置参数,否则因此超时退出 $ git config --global http.lowSpeedLimit 0 $ git config --global http.lowSpeedTime 999999 $ git config --global http.postBuffer 5242880 来源: oschina 链接: https://my.oschina

ASP.NET Core stream video from the OpenCVSharp capture

血红的双手。 提交于 2020-06-27 04:10:19
问题 I want to stream video captured from the webcam using ASP.NET Core application. I also need to do some manipulations with the frames, that's why I'm using OpenCVSharp. Currently I have next developments: html in my view - here I don't know what type I should use <video id="video" preload="auto"> <source src="LiveVideo" type="<< don't know the type >>"/> </video> my controller - here I also don't know the content type, and the main problem: I don't know how to stream the video captured by

openCV从入门到放弃

可紊 提交于 2020-05-09 17:30:14
与图像处理之间的关系,opencv的简介和使用定位 如题...因为偶然的机会需要用到图像处理,像我这么爱学习 并且动手能力又强的人怎么能没有心得笔记呢,哇哈哈哈。非要说的low逼点这玩意儿这玩意儿就是像素处理。找出像素中的特征规律 然后根据这些规律去处理数据,就是图像特征处理 不是什么鸟人工智能 不是什么鸟人工智能 不是什么鸟人工只能 重要的话说3遍,但是普遍的商业公司对外宣称却都是吹嘘的啥人工智能高大上的 ,因为像素数据可以理解为信号量,所以是有一些数学理论或者公式能让他更好的工作的理论基础的,基于这里面的理论深度要说的话某些算法也可以达到很高深,所以称之为智能也不为过。数学不好也不要太害怕。实在很半吊子 那也没法 将就着搞吧 ,比如我 哇哈哈哈哈。 一些基本的知识 图像的像素数据可以理解为信号量,图像像素之间的坐标关系称之为空域 ,主要手段和理念是图形学 形态学。常见进行对象分割和特征查找的手段有 轮廓查找 霍夫圆 联通区域标定 腐蚀 膨胀 等 都是空域算法,其作用本意都是让空域有意义 进行对象分割 形成有意义的数据。 关于滤波: 去噪点 ,其实就是模糊化 让毛刺高波跟周围像素平均 也叫均值滤波 低通滤波。锐化,其实就是让毛刺像素加上跟周围的方差 这样大的被放大 也叫高通滤波 ,可以让边缘更明显。颜色空间的处理 ,简易理解可理解为直方图处理 ,可理解为上面一样,理论化的说

How to pass multiple cv::Mat from c++ dll to opencvsharp Mat c# properly?

时间秒杀一切 提交于 2020-03-05 06:07:10
问题 I'm working on a project which required a dll file for another program written in c# to use (I'm not very familiar with the usage of C++/C#). For the very last step to complete my work, I have a problem with passing "multiple" cv::Mat from dll to C#. I've found some examples on the Internet about C# using OpenCvSharp to receive a cv::Mat from dll, and it worked well like this in my code (it's simplified): //original.hpp extern "C" LIB_API cv::Mat* inference(unsigned char* img_pointer, long

OpenCVSharp介绍

夙愿已清 提交于 2020-01-19 14:09:02
OpenCvSharp 是一个OpenCV的.Net wrapper,应用最新的OpenCV库开发,使用习惯比EmguCV更接近原始的OpenCV,有详细的使用样例供参考。该库采用LGPL发行,对商业应用友好。使用OpenCvSharp,可用C#,VB.NET等语言实现多种流行的图像处理(image processing)与计算机视觉(computer vision)算法。 特点 1.相较于SharperCV与OpenCVDotNet,OpenCvSharp直接封装了更多的OpenCV方法,降低学习难度。 2.大部分了继承了IDisposable接口,方便使用using语句块。 3.不强加面向对象思维,可以直接调用原生风格的OpenCV方法。 4.可以将IplImage直接转为Bitmap(GDI+) 或者WriteableBitmap(WPF)。 5.支持Mono。可以运行于支持Mono的任何平台上(如Linux,BSD,Mac OS X等)。 例程 以下代码使用Canny算法寻找输入图像的边缘信息: 1 usingSystem; 2 usingOpenCvSharp; 3 4 classProgram 5 { 6   staticvoidMain() 7   { 8      using(IplImagesrc=newIplImage("lenna.png",LoadMode

I need recognize text in image using opencvsharp

穿精又带淫゛_ 提交于 2020-01-16 22:01:28
问题 I trying to identify text in an image. Actually I'm trying to identify the text positions in the image then convert it to text. I found a some code written on c++ and I am trying to convert it to c#. Can you help me please? Extracting text OpenCV std::vector<cv::Rect> detectLetters(cv::Mat img) { std::vector<cv::Rect> boundRect;[enter image description here][1] cv::Mat img_gray, img_sobel, img_threshold, element; cvtColor(img, img_gray, CV_BGR2GRAY); cv::Sobel(img_gray, img_sobel, CV_8U, 1, 0

OpenCVSharp: Unable to load DLL 'OpenCvSharpExtern'

本小妞迷上赌 提交于 2019-12-30 12:15:21
问题 I have installed the latest OpenCVSharp 2 (2.4.10.201...) with the NuGet manager in my project. Everything concerning OpenCVSharp.CvMat is working OK (loading, manipulation etc) so I am sure the installation is correct. However I cannot use OpenCVSharp.CPlusPlus at all! The problem is that it doesn't load OpenCvSharpExtern.dll. Error shown from try-catch block: try { Mat mat = new Mat(); } catch (Exception err) { Console.WriteLine( err ); } System.TypeInitializationException: The type

OpenCV (EMGUCV wrapper) integration in Unity

匆匆过客 提交于 2019-12-28 10:06:38
问题 As you know OpenCV is very useful library that let you do amazing and powerful things in Computer vision. So I passed a good time to figure out how to use it in Unity3d, I had many problems, and searching in the Net, I have found several suggestions but not one worked for me. I’m using a Unity Pro 4.0 This version of Emgu CV (emgucv-windows-universal-gpu 2.4.9.1847) My target for unity project is: windows and not web player 回答1: This is what I did for everyone who want to use it: Install this